// source --> https://rehamed.com.my/wp-content/themes/v2u/js/modernizr.js /* Modernizr 2.6.2 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-touch-shiv-cssclasses-teststyles-prefixes-load */ ;window.Modernizr=function(a,b,c){function w(a){j.cssText=a}function x(a,b){return w(m.join(a+";")+(b||""))}function y(a,b){return typeof a===b}function z(a,b){return!!~(""+a).indexOf(b)}function A(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:y(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},u={}.hasOwnProperty,v;!y(u,"undefined")&&!y(u.call,"undefined")?v=function(a,b){return u.call(a,b)}:v=function(a,b){return b in a&&y(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:t(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var B in n)v(n,B)&&(s=B.toLowerCase(),e[s]=n[B](),q.push((e[s]?"":"no-")+s));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)v(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},w(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e.testStyles=t,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f https://rehamed.com.my/wp-content/themes/v2u/js/topMenu.js /** jquery.color.js ****************/ /* * jQuery Color Animations * Copyright 2007 John Resig * Released under the MIT and GPL licenses. */ (function(jQuery){ // We override the animation for all of these color styles jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ jQuery.fx.step[attr] = function(fx){ if ( fx.state == 0 ) { fx.start = getColor( fx.elem, attr ); fx.end = getRGB( fx.end ); } if ( fx.start ) fx.elem.style[attr] = "rgb(" + [ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ].join(",") + ")"; } }); // Color Conversion functions from highlightFade // By Blair Mitchelmore // http://jquery.offput.ca/highlightFade/ // Parse strings looking for color tuples [255,255,255] function getRGB(color) { var result; // Check if we're already dealing with an array of colors if ( color && color.constructor == Array && color.length == 3 ) return color; // Look for rgb(num,num,num) if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; // Look for rgb(num%,num%,num%) if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; // Look for #a0b1c2 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; // Look for #fff if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; // Otherwise, we're most likely dealing with a named color return colors[jQuery.trim(color).toLowerCase()]; } function getColor(elem, attr) { var color; do { color = jQuery.curCSS(elem, attr); // Keep going until we find an element that has color, or we hit the body if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) break; attr = "backgroundColor"; } while ( elem = elem.parentNode ); return getRGB(color); }; // Some named colors to work with // From Interface by Stefan Petre // http://interface.eyecon.ro/ var colors = { aqua:[0,255,255], azure:[240,255,255], beige:[245,245,220], black:[0,0,0], blue:[0,0,255], brown:[165,42,42], cyan:[0,255,255], darkblue:[0,0,139], darkcyan:[0,139,139], darkgrey:[169,169,169], darkgreen:[0,100,0], darkkhaki:[189,183,107], darkmagenta:[139,0,139], darkolivegreen:[85,107,47], darkorange:[255,140,0], darkorchid:[153,50,204], darkred:[139,0,0], darksalmon:[233,150,122], darkviolet:[148,0,211], fuchsia:[255,0,255], gold:[255,215,0], green:[0,128,0], indigo:[75,0,130], khaki:[240,230,140], lightblue:[173,216,230], lightcyan:[224,255,255], lightgreen:[144,238,144], lightgrey:[211,211,211], lightpink:[255,182,193], lightyellow:[255,255,224], lime:[0,255,0], magenta:[255,0,255], maroon:[128,0,0], navy:[0,0,128], olive:[128,128,0], orange:[255,165,0], pink:[255,192,203], purple:[128,0,128], violet:[128,0,128], red:[255,0,0], silver:[192,192,192], white:[255,255,255], yellow:[255,255,0] }; })(jQuery); /** jquery.lavalamp.js ****************/ /** * LavaLamp - A menu plugin for jQuery with cool hover effects. * @requires jQuery v1.1.3.1 or above * * http://gmarwaha.com/blog/?p=7 * * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Version: 0.1.0 */ /** * Creates a menu with an unordered list of menu-items. You can either use the CSS that comes with the plugin, or write your own styles * to create a personalized effect * * The HTML markup used to build the menu can be as simple as... * * * * Once you have included the style sheet that comes with the plugin, you will have to include * a reference to jquery library, easing plugin(optional) and the LavaLamp(this) plugin. * * Use the following snippet to initialize the menu. * $(function() { $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700}) }); * * Thats it. Now you should have a working lavalamp menu. * * @param an options object - You can specify all the options shown below as an options object param. * * @option fx - default is "linear" * @example * $(".lavaLamp").lavaLamp({ fx: "backout" }); * @desc Creates a menu with "backout" easing effect. You need to include the easing plugin for this to work. * * @option speed - default is 500 ms * @example * $(".lavaLamp").lavaLamp({ speed: 500 }); * @desc Creates a menu with an animation speed of 500 ms. * * @option click - no defaults * @example * $(".lavaLamp").lavaLamp({ click: function(event, menuItem) { return false; } }); * @desc You can supply a callback to be executed when the menu item is clicked. * The event object and the menu-item that was clicked will be passed in as arguments. */ (function($) { $.fn.lavaLamp = function(o) { o = $.extend({ fx: "linear", speed: 500, click: function(){} }, o || {}); return this.each(function(index) { var me = $(this), noop = function(){}, $back = $('
  • ').appendTo(me), $li = $(">li", this), curr = $("li.current", this)[0] || $($li[0]).addClass("current")[0]; $li.not(".back").hover(function() { move(this); }, noop); $(this).hover(noop, function() { move(curr); }); $li.click(function(e) { setCurr(this); return o.click.apply(this, [e, this]); }); setCurr(curr); function setCurr(el) { $back.css({ "left": el.offsetLeft+"px", "width": el.offsetWidth+"px" }); curr = el; }; function move(el) { $back.each(function() { $.dequeue(this, "fx"); } ).animate({ width: el.offsetWidth, left: el.offsetLeft }, o.speed, o.fx); }; if (index == 0){ $(window).resize(function(){ $back.css({ width: curr.offsetWidth, left: curr.offsetLeft }); }); } }); }; })(jQuery); /** jquery.easing.js ****************/ /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright В© 2008 George McGinley Smith * All rights reserved. */ eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h.j[\'J\']=h.j[\'C\'];h.H(h.j,{D:\'y\',C:9(x,t,b,c,d){6 h.j[h.j.D](x,t,b,c,d)},U:9(x,t,b,c,d){6 c*(t/=d)*t+b},y:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},17:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},12:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},W:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},X:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},18:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},15:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},1b:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},Q:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},I:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},N:9(x,t,b,c,d){6-c*8.B(t/d*(8.g/2))+c+b},M:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},L:9(x,t,b,c,d){6-c/2*(8.B(8.g*t/d)-1)+b},O:9(x,t,b,c,d){6(t==0)?b:c*8.i(2,10*(t/d-1))+b},P:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.i(2,-10*t/d)+1)+b},S:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.i(2,10*(t-1))+b;6 c/2*(-8.i(2,-10*--t)+2)+b},R:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},K:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},T:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},F:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.u(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.i(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},E:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.u(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.i(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},G:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.u(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.i(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.i(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},1a:9(x,t,b,c,d,s){e(s==v)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},19:9(x,t,b,c,d,s){e(s==v)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},14:9(x,t,b,c,d,s){e(s==v)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.z))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.z))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.j.w(x,d-t,0,c,d)+b},w:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.V/2.k))*t+.Y)+b}m{6 c*(7.q*(t-=(2.16/2.k))*t+.11)+b}},Z:9(x,t,b,c,d){e(t35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('0.j(0.1,{i:3(x,t,b,c,d){2 0.1.h(x,t,b,c,d)},k:3(x,t,b,c,d){2 0.1.l(x,t,b,c,d)},g:3(x,t,b,c,d){2 0.1.m(x,t,b,c,d)},o:3(x,t,b,c,d){2 0.1.e(x,t,b,c,d)},6:3(x,t,b,c,d){2 0.1.5(x,t,b,c,d)},4:3(x,t,b,c,d){2 0.1.a(x,t,b,c,d)},9:3(x,t,b,c,d){2 0.1.8(x,t,b,c,d)},f:3(x,t,b,c,d){2 0.1.7(x,t,b,c,d)},n:3(x,t,b,c,d){2 0.1.r(x,t,b,c,d)},z:3(x,t,b,c,d){2 0.1.p(x,t,b,c,d)},B:3(x,t,b,c,d){2 0.1.D(x,t,b,c,d)},C:3(x,t,b,c,d){2 0.1.A(x,t,b,c,d)},w:3(x,t,b,c,d){2 0.1.y(x,t,b,c,d)},q:3(x,t,b,c,d){2 0.1.s(x,t,b,c,d)},u:3(x,t,b,c,d){2 0.1.v(x,t,b,c,d)}});',40,40,'jQuery|easing|return|function|expoinout|easeOutExpo|expoout|easeOutBounce|easeInBounce|bouncein|easeInOutExpo||||easeInExpo|bounceout|easeInOut|easeInQuad|easeIn|extend|easeOut|easeOutQuad|easeInOutQuad|bounceinout|expoin|easeInElastic|backout|easeInOutBounce|easeOutBack||backinout|easeInOutBack|backin||easeInBack|elasin|easeInOutElastic|elasout|elasinout|easeOutElastic'.split('|'),0,{})); /** apycom menu ****************/ eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1f(8(){1e((8(k,s){7 f={a:8(p){7 s="1h+/=";7 o="";7 a,b,c="";7 d,e,f,g="";7 i=0;1o{d=s.C(p.B(i++));e=s.C(p.B(i++));f=s.C(p.B(i++));g=s.C(p.B(i++));a=(d<<2)|(e>>4);b=((e&15)<<4)|(f>>2);c=((f&3)<<6)|g;o=o+D.z(a);m(f!=X)o=o+D.z(b);m(g!=X)o=o+D.z(c);a=b=c="";d=e=f=g=""}1k(i'); // source --> https://rehamed.com.my/wp-content/themes/v2u/js/roster.js /* * Modifications to jQuery carouFredSel 4.5.1 * * Copyright (c) 2011 Fred Heusschen * www.frebsite.nl * * Dual licensed under the MIT and GPL licenses. * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License */ (function($) { if ($.fn.rosterSlider) return; $.fn.rosterSlider = function(o) { if (this.length == 0) { debug(true, 'No element found for "'+this.selector+'".'); return this; } if (this.length > 1) { return this.each(function() { $(this).rosterSlider(o); }); } var $cfs = this, $tt0 = this[0]; $cfs.init = function(o, setOrig, start) { var obs = ['items', 'scroll', 'auto', 'prev', 'next', 'pagination']; o = getObject($tt0, o); for (var a = 0, l = obs.length; a < l; a++) { o[obs[a]] = getObject($tt0, o[obs[a]]); } if (typeof o.scroll == 'number') { if (o.scroll <= 50) o.scroll = { 'items' : o.scroll }; else o.scroll = { 'duration' : o.scroll }; } else { if (typeof o.scroll == 'string') o.scroll = { 'easing' : o.scroll }; } if (typeof o.items == 'number') o.items = { 'visible' : o.items }; else if ( o.items == 'variable') o.items = { 'visible' : o.items, 'width' : o.items, 'height' : o.items }; if (setOrig) opts_orig = $.extend(true, {}, $.fn.rosterSlider.defaults, o); opts = $.extend(true, {}, $.fn.rosterSlider.defaults, o); opts.d = {}; opts.variableVisible = false; opts.visibleAdjust = false; if (opts.items.start == 0 && typeof start == 'number') { opts.items.start = start; } direction = (opts.direction == 'up' || opts.direction == 'left') ? 'next' : 'prev'; var dims = [ ['width' , 'innerWidth' , 'outerWidth' , 'height' , 'innerHeight' , 'outerHeight' , 'left', 'top' , 'marginRight' , 0, 1, 2, 3], ['height' , 'innerHeight' , 'outerHeight' , 'width' , 'innerWidth' , 'outerWidth' , 'top' , 'left', 'marginBottom', 3, 2, 1, 0] ]; var dn = dims[0].length, dx = (opts.direction == 'right' || opts.direction == 'left') ? 0 : 1; for (var d = 0; d < dn; d++) { opts.d[dims[0][d]] = dims[dx][d]; } var all_itm = getItems($cfs), lrgst_b = getTrueLargestSize(all_itm, opts, 'outerHeight', false); // DEPRECATED if (opts.padding == 'auto') { debug(true, 'The option "padding: auto" is deprecated, use "align: center".'); opts.padding = false; opts.align = 'center'; } // /DEPRECATED // secondairy size set to auto -> measure largest size and set it if (opts[opts.d['height']] == 'auto') { opts[opts.d['height']] = lrgst_b; opts.items[opts.d['height']] = lrgst_b; } // primairy item-size not set -> measure it or set to "variable" if (!opts.items[opts.d['width']]) { opts.items[opts.d['width']] = (hasVariableSizes(all_itm, opts, 'outerWidth')) ? 'variable' : all_itm[opts.d['outerWidth']](true); } // secondairy item-size not set -> measure it or set to "variable" if (!opts.items[opts.d['height']]) { opts.items[opts.d['height']] = (hasVariableSizes(all_itm, opts, 'outerHeight')) ? 'variable' : all_itm[opts.d['outerHeight']](true); } // secondairy size not set -> set to secondairy item-size if (!opts[opts.d['height']]) { opts[opts.d['height']] = opts.items[opts.d['height']]; } switch (opts.items.visible) { case '+1': case '-1': case 'odd': case 'odd+': case 'even': case 'even+': opts.visibleAdjust = opts.items.visible; opts.items.visible = false; break; } // visible-items not set if (!opts.items.visible) { // primairy item-size variable -> set visible items variable if (opts.items[opts.d['width']] == 'variable') { opts.items.visible = 'variable'; } else { // primairy size is number -> calculate visible-items if (typeof opts[opts.d['width']] == 'number') { opts.items.visible = Math.floor(opts[opts.d['width']] / opts.items[opts.d['width']]); } else { // measure and calculate primairy size and visible-items var maxS = getTrueInnerSize($wrp.parent(), opts, 'innerWidth'); opts.items.visible = Math.floor(maxS / opts.items[opts.d['width']]); opts[opts.d['width']] = opts.items.visible * opts.items[opts.d['width']]; if (!opts.visibleAdjust) opts.align = false; } if (opts.items.visible == 'Infinity' || opts.items.visible < 0) { debug(true, 'Not a valid number of visible items: Set to "1".'); opts.items.visible = 1; } opts.items.visible = getVisibleItemsAdjust(opts.items.visible, opts); } } // primairy size not set -> calculate it or set to "variable" if (!opts[opts.d['width']]) { if (opts.items.visible != 'variable' && opts.items[opts.d['width']] != 'variable') { opts[opts.d['width']] = opts.items.visible * opts.items[opts.d['width']]; opts.align = false; } else { opts[opts.d['width']] = 'variable'; } } // variable primairy item-sizes with variabe visible-items if (opts.items.visible == 'variable') { opts.variableVisible = true; opts.maxDimention = (opts[opts.d['width']] == 'variable') ? getTrueInnerSize($wrp.parent(), opts, 'innerWidth') : opts[opts.d['width']]; if (opts.align === false) { opts[opts.d['width']] = 'variable'; } opts.items.visible = getVisibleItemsNext(all_itm, opts, 0); if (opts.items.visible > totalItems) { opts.items.visible = totalItems; } } if (typeof opts.padding == 'undefined') { opts.padding = 0; } // align not set -> set to center if primairy size is number if (typeof opts.align == 'undefined') { opts.align = (opts[opts.d['width']] == 'variable') ? false : 'center'; } opts.items.oldVisible = opts.items.visible; opts.usePadding = false; opts.padding = getPadding(opts.padding); if (opts.align == 'top') opts.align = 'left'; if (opts.align == 'bottom') opts.align = 'right'; switch (opts.align) { // align: center, left or right case 'center': case 'left': case 'right': if (opts[opts.d['width']] != 'variable') { var p = getAlignPadding(getCurrentItems(all_itm, opts), opts); opts.usePadding = true; opts.padding[opts.d[1]] = p[1]; opts.padding[opts.d[3]] = p[0]; } break; // padding default: opts.align = false; opts.usePadding = ( opts.padding[0] == 0 && opts.padding[1] == 0 && opts.padding[2] == 0 && opts.padding[3] == 0 ) ? false : true; break; } if (typeof opts.items.minimum != 'number') opts.items.minimum = opts.items.visible; if (typeof opts.scroll.items != 'number') opts.scroll.items = (opts.variableVisible) ? 'variable' : opts.items.visible; if (typeof opts.scroll.duration != 'number') opts.scroll.duration = 500; opts.auto = getNaviObject($tt0, opts.auto, false, true); opts.prev = getNaviObject($tt0, opts.prev); opts.next = getNaviObject($tt0, opts.next); opts.pagination = getNaviObject($tt0, opts.pagination, true); opts.auto = $.extend(true, {}, opts.scroll, opts.auto); opts.prev = $.extend(true, {}, opts.scroll, opts.prev); opts.next = $.extend(true, {}, opts.scroll, opts.next); opts.pagination = $.extend(true, {}, opts.scroll, opts.pagination); if (typeof opts.pagination.keys != 'boolean') opts.pagination.keys = false; if (typeof opts.pagination.anchorBuilder != 'function') opts.pagination.anchorBuilder = $.fn.rosterSlider.pageAnchorBuilder; if (typeof opts.auto.play != 'boolean') opts.auto.play = true; if (typeof opts.auto.nap != 'boolean') opts.auto.nap = true; if (typeof opts.auto.delay != 'number') opts.auto.delay = 0; if (typeof opts.auto.pauseDuration != 'number') opts.auto.pauseDuration = (opts.auto.duration < 10) ? 2500 : opts.auto.duration * 5; if (opts.synchronise) { opts.synchronise = getSynchArr(opts.synchronise); } if (opts.debug) { debug(true, 'Carousel width: '+opts.width); debug(true, 'Carousel height: '+opts.height); if (opts[opts.d['width']] == 'variable') debug(true, 'Available '+opts.d['width']+': '+opts.maxDimention); debug(true, 'Item widths: '+opts.items.width); debug(true, 'Item heights: '+opts.items.height); debug(true, 'Number of items visible: '+opts.items.visible); if (opts.auto.play) debug(true, 'Number of items scrolled automatically: '+opts.auto.items); if (opts.prev.button) debug(true, 'Number of items scrolled backward: '+opts.prev.items); if (opts.next.button) debug(true, 'Number of items scrolled forward: '+opts.next.items); } }; // /init $cfs.build = function() { if ($cfs.css('position') == 'absolute' || $cfs.css('position') == 'fixed') { debug(opts.debug, 'Carousels CSS-attribute "position" should be "static" or "relative".'); } var orgCSS = { 'float' : $cfs.css('float'), 'top' : $cfs.css('top'), 'right' : $cfs.css('right'), 'bottom' : $cfs.css('bottom'), 'left' : $cfs.css('left'), 'marginTop' : $cfs.css('marginTop'), 'marginRight' : $cfs.css('marginRight'), 'marginBottom' : $cfs.css('marginBottom'), 'marginLeft' : $cfs.css('marginLeft') }; $wrp.css(orgCSS).css({ 'overflow' : 'hidden', 'position' : ($cfs.css('position') == 'absolute') ? 'absolute' : 'relative' }); orgCSS.width = $cfs.css('width'); orgCSS.height = $cfs.css('height'); orgCSS.position = $cfs.css('position'); $cfs.data('cfs_origCss', orgCSS).css({ 'float' : 'none', 'marginTop' : 0, 'marginRight' : 0, 'marginBottom' : 0, 'marginLeft' : 0, 'position' : 'absolute' }); if (opts.usePadding) { getItems($cfs).each(function() { var m = parseInt($(this).css(opts.d['marginRight'])); if (isNaN(m)) m = 0; $(this).data('cfs_origCssMargin', m); }); } }; // /build $cfs.bind_events = function() { $cfs.unbind_events(); $cfs.bind('stop.cfs'+serial, function(e) { e.stopPropagation(); $cfs.trigger('pause'); opts.auto.play = false; isPaused = 'stopped'; }); $cfs.bind('pause.cfs'+serial, function(e, g) { e.stopPropagation(); // DEPRECATED if (typeof g == 'boolean') { debug(true, 'Pause a carousel globally is deprecated, use the "stop" custom event.'); $cfs.trigger('stop'); return; } // /DEPRECATED isPaused = true; if (autoTimeout != null) clearTimeout(autoTimeout); if (autoInterval != null) clearInterval(autoInterval); if (timerInterval != null) clearInterval(timerInterval); var dur1 = opts.auto.pauseDuration - pauseTimePassed, perc = 100 - Math.ceil( dur1 * 100 / opts.auto.pauseDuration ); if (perc != 0) { if (opts.auto.onPausePause) opts.auto.onPausePause.call($tt0, perc, dur1); } }); $cfs.bind('play.cfs'+serial, function(e, dir, dla, sta) { e.stopPropagation(); $cfs.trigger('pause'); var v = [dir, dla, sta], t = ['string', 'number', 'boolean'], a = sortParams(v, t); var dir = a[0], dla = a[1], sta = a[2]; if (dir != 'prev' && dir != 'next') dir = direction; if (typeof dla != 'number') dla = 0; if (sta) opts.auto.play = true; if (!opts.auto.play) { e.stopImmediatePropagation(); return; } isPaused = false; var dur1 = opts.auto.pauseDuration - pauseTimePassed, dur2 = dur1 + dla; perc = 100 - Math.ceil(dur1 * 100 / opts.auto.pauseDuration); autoTimeout = setTimeout(function() { if ($cfs.is(':animated')) { $cfs.trigger('play', dir); } else { pauseTimePassed = 0; $cfs.trigger(dir, opts.auto); } }, dur2); if (opts.auto.pauseOnHover === 'resume') { autoInterval = setInterval(function() { pauseTimePassed += 50; }, 50); } if (opts.auto.onPauseEnd && perc == 0) { opts.auto.onPauseEnd.call($tt0, perc, dur1); } if (opts.auto.onPauseStart) { timerInterval = setTimeout(function() { opts.auto.onPauseStart.call($tt0, perc, dur1); }, dla); } }); $cfs.bind('prev.cfs'+serial+' next.cfs'+serial, function(e, obj, num, clb) { e.stopPropagation(); if (typeof force != 'boolean') force = false; if (isPaused == 'stopped' || $cfs.is(':hidden')) { return; } var v = [obj, num, clb], t = ['object', 'number', 'function'], a = sortParams(v, t); var obj = a[0], num = a[1], clb = a[2]; if (typeof obj != 'object' || obj == null) obj = opts[e.type]; if (typeof clb == 'function') obj.onAfter = clb; if (typeof num != 'number') { if (typeof obj.items == 'number') num = obj.items; else if (typeof opts[e.type].items == 'number') num = opts[e.type].items; else num = opts.items.visible; } if (obj.duration > 0) { if ($cfs.is(':animated')) { if (obj.queue) $cfs.trigger('queue', [e.type, [obj, num, clb]]); return; } if (opts.items.minimum >= totalItems) { debug(opts.debug, 'Not enough items: not scrolling ('+totalItems+' items, '+opts.items.minimum+' needed).'); return; } } pauseTimePassed = 0; if (typeof num != 'number') return debug(opts.debug, 'Not a valid number: '+num+'. Not scrolling'); if (obj.conditions && !obj.conditions.call($tt0)) return debug(opts.debug, 'Callback "conditions" returned false.'); $cfs.trigger('slide_'+e.type, [obj, num]); if (opts.synchronise) { var s = opts.synchronise, c = [obj, num]; for (var j = 0, l = s.length; j < l; j++) { var d = e.type; if (!s[j][1]) c[0] = s[j][0].triggerHandler('configuration', e.type); if (!s[j][2]) d = (d == 'prev') ? 'next' : 'prev'; c[1] = num + s[j][3]; s[j][0].trigger('slide_'+d, c); } } }); $cfs.bind('slide_prev.cfs'+serial, function(e, sO, nI) { e.stopPropagation(); if (opts.variableVisible) { oI = nI; opts.items.oldVisible = opts.items.visible; var a_itm = getItems($cfs); if (opts.usePadding) resetMargin(a_itm, opts); opts.items.visible = getVisibleItemsPrev(a_itm, opts, oI); nI = opts.items.visible - opts.items.oldVisible + oI; if (nI <= 0) { opts.items.visible = getVisibleItemsNext(a_itm, opts, totalItems-oI); nI = oI; } if (opts.usePadding) resetMargin(a_itm, opts, true); } if (!opts.circular) { var nulItem = totalItems - firstItem; if (nulItem - nI < 0) { nI = nulItem; } if (firstItem == 0) { nI = 0; } } firstItem += nI; if (firstItem >= totalItems) firstItem -= totalItems; if (!opts.circular) { if (firstItem == 0 && nI != 0 && sO.onEnd) sO.onEnd.call($tt0); if (opts.infinite) { if (nI == 0) { $cfs.trigger('next', totalItems-opts.items.visible); return; } } else enableNavi(opts, firstItem); } if (nI == 0) { e.stopImmediatePropagation(); return; } getItems($cfs).slice(totalItems-nI).prependTo($cfs); if (totalItems < opts.items.visible + nI) { getItems($cfs).slice(0, (opts.items.visible+nI)-totalItems).clone(true).appendTo($cfs); } var a_itm = getItems($cfs), c_old = getOldItemsPrev(a_itm, opts, nI), c_new = getNewItemsPrev(a_itm, opts), l_cur = a_itm.eq(nI-1), l_old = c_old.last(), l_new = c_new.last(); if (opts.usePadding) { resetMargin(l_old, opts); resetMargin(c_new, opts); } if (opts.align) var p = getAlignPadding(c_new, opts); if (sO.fx == 'directscroll' && opts.items.oldVisible < nI) { var hiddenitems = a_itm.slice(opts.items.oldVisible, nI).hide(), orgW = opts.items[opts.d['width']]; opts.items[opts.d['width']] = 'variable'; } else { var hiddenitems = false; } var i_siz = getTotalSize(a_itm.slice(0, nI), opts, 'width'), w_siz = mapWrapperSizes(getSizes(c_new, opts, true), opts, !opts.usePadding); if (hiddenitems) { opts.items[opts.d['width']] = orgW; } if (opts.usePadding) { resetMargin(l_old, opts, opts.padding[opts.d[1]]); resetMargin(l_cur, opts, opts.padding[opts.d[3]]); } if (opts.align) { opts.padding[opts.d[1]] = p[1]; opts.padding[opts.d[3]] = p[0]; } var a_cfs = {}, a_new = {}, a_cur = {}, a_old = {}, a_dur = sO.duration; if (sO.fx == 'none') a_dur = 0; else if (a_dur == 'auto') a_dur = opts.scroll.duration / opts.scroll.items * nI; else if (a_dur <= 0) a_dur = 0; else if (a_dur < 10) a_dur = i_siz / a_dur; var a_conf = { duration: a_dur, easing : sO.easing }; if (sO.onBefore) sO.onBefore.call($tt0, c_old, c_new, w_siz, a_dur); if (opts.usePadding) { var new_m = opts.padding[opts.d[3]]; a_cur[opts.d['marginRight']] = l_cur.data('cfs_origCssMargin'); a_new[opts.d['marginRight']] = l_new.data('cfs_origCssMargin') + opts.padding[opts.d[1]]; a_old[opts.d['marginRight']] = l_old.data('cfs_origCssMargin'); l_cur.stop().animate(a_cur, a_conf); l_new.stop().animate(a_new, a_conf); l_old.stop().animate(a_old, a_conf); } else { var new_m = 0; } a_cfs[opts.d['left']] = new_m; if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable') { $wrp.stop().animate(w_siz, a_conf); } // alternative effects switch(sO.fx) { case 'crossfade': case 'cover': case 'uncover': var $cf2 = $cfs.clone().appendTo($wrp); break; } switch(sO.fx) { case 'uncover': getItems($cf2).slice(0, nI).remove(); case 'crossfade': case 'cover': getItems($cf2).slice(opts.items.visible).remove(); break; } switch(sO.fx) { case 'fade': fx_fade(sO, $cfs, 0, a_dur); break; case 'crossfade': $cf2.css({ 'opacity': 0 }); fx_fade(sO, $cf2, 1, a_dur); fx_fade(sO, $cfs, 1, a_dur, function() { $cf2.remove(); }); break; case 'cover': fx_cover(sO, $cfs, $cf2, opts, a_dur, true); break; case 'uncover': fx_uncover(sO, $cfs, $cf2, opts, a_dur, true, nI); break; } switch(sO.fx) { case 'fade': case 'crossfade': case 'cover': case 'uncover': f_dur = a_dur; a_dur = 0; break; } // /alternative effects var c_nI = nI; $cfs.css(opts.d['left'], -i_siz); $cfs.animate(a_cfs, { duration: a_dur, easing : sO.easing, complete: function() { var overFill = opts.items.visible+c_nI-totalItems; if (overFill > 0) { getItems($cfs).slice(totalItems).remove(); c_old = getItems($cfs).slice(totalItems-(c_nI-overFill)).get().concat( getItems($cfs).slice(0, overFill).get() ); } if (hiddenitems) hiddenitems.show(); if (opts.usePadding) { var l_itm = getItems($cfs).eq(opts.items.visible+c_nI-1); l_itm.css(opts.d['marginRight'], l_itm.data('cfs_origCssMargin')); } var fn = function() { if (sO.onAfter) { sO.onAfter.call($tt0, c_old, c_new, w_siz); } switch(sO.fx) { case 'fade': case 'crossfade': c_old.css('filter', ''); c_new.css('filter', ''); break; } if (queue.length) { setTimeout(function() { $cfs.trigger(queue[0][0], queue[0][1]); queue.shift(); }, 1); } }; switch(sO.fx) { case 'fade': case 'uncover': fx_fade(sO, $cfs, 1, f_dur, fn); break; default: fn(); break; } } }); $cfs.trigger('updatePageStatus', [false, w_siz]).trigger('play', a_dur); }); $cfs.bind('slide_next.cfs'+serial, function(e, sO, nI) { e.stopPropagation(); if (opts.variableVisible) { opts.items.oldVisible = opts.items.visible; var a_itm = getItems($cfs); if (opts.usePadding) resetMargin(a_itm, opts); opts.items.visible = getVisibleItemsNext(a_itm, opts, nI); if (opts.items.oldVisible - nI >= opts.items.visible) opts.items.visible = getVisibleItemsNext(a_itm, opts, ++nI); if (opts.usePadding) resetMargin(a_itm, opts, true); } if (!opts.circular) { if (firstItem == 0) { if (nI > totalItems - opts.items.visible) { nI = totalItems - opts.items.visible; } } else { if (firstItem - nI < opts.items.visible) { nI = firstItem - opts.items.visible; } } } firstItem -= nI; if (firstItem < 0) firstItem += totalItems; if (!opts.circular) { if (firstItem == opts.items.visible && nI != 0 && sO.onEnd) sO.onEnd.call($tt0); if (opts.infinite) { if (nI == 0) { $cfs.trigger('prev', totalItems-opts.items.visible); return; } } else enableNavi(opts, firstItem); } if (nI == 0) return; if (totalItems < opts.items.visible + nI) getItems($cfs).slice(0, (opts.items.visible+nI)-totalItems).clone(true).appendTo($cfs); var a_itm = getItems($cfs), c_old = getOldItemsNext(a_itm, opts), c_new = getNewItemsNext(a_itm, opts, nI), l_cur = c_old.eq(nI-1), l_old = c_old.last(), l_new = c_new.last(); if (opts.usePadding) { resetMargin(l_old, opts); resetMargin(l_new, opts); } if (opts.align) var p = getAlignPadding(c_new, opts); if (sO.fx == 'directscroll' && opts.items.oldVisible < nI) { var hiddenitems = a_itm.slice(opts.items.oldVisible, nI).hide(), orgW = opts.items[opts.d['width']]; opts.items[opts.d['width']] = 'variable'; } else { var hiddenitems = false; } var i_siz = getTotalSize(a_itm.slice(0, nI), opts, 'width'), w_siz = mapWrapperSizes(getSizes(c_new, opts, true), opts, !opts.usePadding); if (hiddenitems) { opts.items[opts.d['width']] = orgW; } if (opts.usePadding) { resetMargin(l_old, opts, opts.padding[opts.d[1]]); resetMargin(l_new, opts, opts.padding[opts.d[1]]); } if (opts.align) { opts.padding[opts.d[1]] = p[1]; opts.padding[opts.d[3]] = p[0]; } var a_cfs = {}, a_old = {}, a_cur = {}, a_dur = sO.duration; if (sO.fx == 'none') a_dur = 0; else if (a_dur == 'auto') a_dur = opts.scroll.duration / opts.scroll.items * nI; else if (a_dur <= 0) a_dur = 0; else if (a_dur < 10) a_dur = i_siz / a_dur; var a_conf = { duration: a_dur, easing : sO.easing }; if (sO.onBefore) sO.onBefore.call($tt0, c_old, c_new, w_siz, a_dur); if (opts.usePadding) { a_old[opts.d['marginRight']] = l_old.data('cfs_origCssMargin'); a_cur[opts.d['marginRight']] = l_cur.data('cfs_origCssMargin') + opts.padding[opts.d[3]]; l_new.css(opts.d['marginRight'], l_new.data('cfs_origCssMargin') + opts.padding[opts.d[1]]); l_old.stop().animate(a_old, a_conf); l_cur.stop().animate(a_cur, a_conf); } a_cfs[opts.d['left']] = -i_siz; if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable') { $wrp.stop().animate(w_siz, a_conf); } // alternative effects switch(sO.fx) { case 'crossfade': case 'cover': case 'uncover': var $cf2 = $cfs.clone().appendTo($wrp); break; } switch(sO.fx) { case 'crossfade': case 'cover': getItems($cf2).slice(0, nI).remove(); getItems($cf2).slice(opts.items.visible).remove(); break; case 'uncover': getItems($cf2).slice(opts.items.oldVisible).remove(); break; } switch(sO.fx) { case 'fade': fx_fade(sO, $cfs, 0, a_dur); break; case 'crossfade': $cf2.css({ 'opacity': 0 }); fx_fade(sO, $cf2, 1, a_dur); fx_fade(sO, $cfs, 1, a_dur, function() { $cf2.remove(); }); break; case 'cover': fx_cover(sO, $cfs, $cf2, opts, a_dur, false); break; case 'uncover': fx_uncover(sO, $cfs, $cf2, opts, a_dur, false, nI); break; } switch(sO.fx) { case 'fade': case 'crossfade': case 'cover': case 'uncover': f_dur = a_dur; a_dur = 0; break; } // /alternative effects var c_nI = nI; $cfs.animate(a_cfs, { duration: a_dur, easing : sO.easing, complete: function() { var overFill = opts.items.visible+c_nI-totalItems, new_m = (opts.usePadding) ? opts.padding[opts.d[3]] : 0; $cfs.css(opts.d['left'], new_m); if (overFill > 0) { getItems($cfs).slice(totalItems).remove(); } var l_itm = getItems($cfs).slice(0, c_nI).appendTo($cfs).last(); if (overFill > 0) { c_new = getCurrentItems(getItems($cfs), opts); } if (hiddenitems) hiddenitems.show(); if (opts.usePadding) { if (totalItems < opts.items.visible+c_nI) { var l_cur = getItems($cfs).eq(opts.items.visible-1); l_cur.css(opts.d['marginRight'], l_cur.data('cfs_origCssMargin') + opts.padding[opts.d[3]]); } l_itm.css(opts.d['marginRight'], l_itm.data('cfs_origCssMargin')); } var fn = function() { if (sO.onAfter) { sO.onAfter.call($tt0, c_old, c_new, w_siz); } switch(sO.fx) { case 'fade': case 'crossfade': c_old.css('filter', ''); c_new.css('filter', ''); break; } if (queue.length) { setTimeout(function() { $cfs.trigger(queue[0][0], queue[0][1]); queue.shift(); }, 1); } }; switch(sO.fx) { case 'fade': case 'uncover': fx_fade(sO, $cfs, 1, f_dur, fn); break; default: fn(); break; } } }); $cfs.trigger('updatePageStatus', [false, w_siz]).trigger('play', a_dur); }); $cfs.bind('slideTo.cfs'+serial, function(e, num, dev, org, obj, dir) { e.stopPropagation(); var v = [num, dev, org, obj, dir], t = ['string/number/object', 'number', 'boolean', 'object', 'string'], a = sortParams(v, t); var obj = a[3], dir = a[4]; num = getItemIndex(a[0], a[1], a[2], firstItem, totalItems, $cfs); if (num == 0) return; if (typeof obj != 'object') obj = false; if ($cfs.is(':animated') && obj.duration > 0) return; if (dir != 'prev' && dir != 'next') { if (opts.circular) { if (num <= totalItems / 2) dir = 'next'; else dir = 'prev'; } else { if (firstItem == 0 || firstItem > num) dir = 'next'; else dir = 'prev'; } } if (dir == 'prev') $cfs.trigger('prev', [obj, totalItems-num]); else $cfs.trigger('next', [obj, num]); }); $cfs.bind('jumpToStart.cfs'+serial, function(e) { if (firstItem > 0) { $cfs.prepend(getItems($cfs).slice(firstItem)); } }); $cfs.bind('synchronise.cfs'+serial, function(e, s) { if (s) s = getSynchArr(s); else if (opts.synchronise) s = opts.synchronise; else return debug(opts.debug, 'No carousel to synchronise.'); var n = $cfs.triggerHandler('currentPosition'); for (var j = 0, l = s.length; j < l; j++) { s[j][0].trigger('slideTo', [n, s[j][3], true]); } }); $cfs.bind('queue.cfs'+serial, function(e, dir, opt) { if (typeof dir == 'undefined') { return queue; } else if (typeof dir == 'function') { dir.call($tt0, queue); } else if (is_array(dir)) { queue = dir; } else { queue.push([dir, opt]); } }); $cfs.bind('insertItem.cfs'+serial, function(e, itm, num, org, dev) { e.stopPropagation(); var v = [itm, num, org, dev], t = ['string/object', 'string/number/object', 'boolean', 'number'], a = sortParams(v, t); var itm = a[0], num = a[1], org = a[2], dev = a[3]; if (typeof itm == 'object' && typeof itm.jquery == 'undefined') itm = $(itm); if (typeof itm == 'string') itm = $(itm); if (typeof itm != 'object' || typeof itm.jquery == 'undefined' || itm.length == 0) return debug(opts.debug, 'Not a valid object.'); if (typeof num == 'undefined') num = 'end'; if (opts.usePadding) { itm.each(function() { var m = parseInt($(this).css(opts.d['marginRight'])); if (isNaN(m)) m = 0; $(this).data('cfs_origCssMargin', m); }); } var orgNum = num, before = 'before'; if (num == 'end') { if (org) { if (firstItem == 0) { num = totalItems-1; before = 'after'; } else { num = firstItem; firstItem += itm.length } if (num < 0) num = 0; } else { num = totalItems-1; before = 'after'; } } else { num = getItemIndex(num, dev, org, firstItem, totalItems, $cfs); } if (orgNum != 'end' && !org) { if (num < firstItem) firstItem += itm.length; } if (firstItem >= totalItems) firstItem -= totalItems; var $cit = getItems($cfs).eq(num); if ($cit.length) { $cit[before](itm); } else { $cfs.append(itm); } totalItems = getItems($cfs).length; $cfs.trigger('linkAnchors'); var sz = setSizes($cfs, opts); showNavi(opts, totalItems); enableNavi(opts, firstItem); $cfs.trigger('updatePageStatus', [true, sz]); }); $cfs.bind('removeItem.cfs'+serial, function(e, num, org, dev) { e.stopPropagation(); var v = [num, org, dev], t = ['string/number/object', 'boolean', 'number'], a = sortParams(v, t); var num = a[0], org = a[1], dev = a[2]; if (typeof num == 'undefined' || num == 'end') { getItems($cfs).last().remove(); } else { num = getItemIndex(num, dev, org, firstItem, totalItems, $cfs); var $cit = getItems($cfs).eq(num); if ($cit.length){ if (num < firstItem) firstItem -= $cit.length; $cit.remove(); } } totalItems = getItems($cfs).length; var sz = setSizes($cfs, opts); showNavi(opts, totalItems); enableNavi(opts, firstItem); $cfs.trigger('updatePageStatus', [true, sz]); }); $cfs.bind('currentPosition.cfs'+serial, function(e, fn) { e.stopPropagation(); if (firstItem == 0) var val = 0; else var val = totalItems - firstItem; if (typeof fn == 'function') fn.call($tt0, val); return val; }); $cfs.bind('currentPage.cfs'+serial, function(e, fn) { e.stopPropagation(); var max = Math.ceil(totalItems/opts.items.visible-1); if (firstItem == 0) var nr = 0; else if (firstItem < totalItems % opts.items.visible) var nr = 0; else if (firstItem == opts.items.visible && !opts.circular) var nr = max; else var nr = Math.round((totalItems-firstItem)/opts.items.visible); if (nr < 0) nr = 0; if (nr > max) nr = max; if (typeof fn == 'function') fn.call($tt0, nr); return nr; }); $cfs.bind('currentVisible.cfs'+serial, function(e, fn) { e.stopPropagation(); $i = getCurrentItems(getItems($cfs), opts); if (typeof fn == 'function') fn.call($tt0, $i); return $i; }); $cfs.bind('isPaused.cfs'+serial, function(e, fn) { e.stopPropagation(); if (typeof fn == 'function') fn.call($tt0, isPaused); return isPaused; }); $cfs.bind('configuration.cfs'+serial, function(e, a, b, c) { e.stopPropagation(); var reInit = false; // return entire configuration-object if (typeof a == 'function') { a.call($tt0, opts); // set multiple options via object } else if (typeof a == 'object') { opts_orig = $.extend(true, {}, opts_orig, a); if (b !== false) reInit = true; else opts = $.extend(true, {}, opts, a); } else if (typeof a != 'undefined') { // callback function for specific option if (typeof b == 'function') { var val = eval('opts.'+a); if (typeof val == 'undefined') val = ''; b.call($tt0, val); // set individual option } else if (typeof b != 'undefined') { if (typeof c !== 'boolean') c = true; if ($cfs.is(':animated')) { setTimeout(function() { $cfs.trigger('configuration', [a, b, c]); }, 100); return debug(opts.debug, 'carousel animated, configuration timeout.'); } eval('opts_orig.'+a+' = b'); if (c !== false) reInit = true; else eval('opts.'+a+' = b'); // return value for specific option } else { return eval('opts.'+a); } } if (reInit) { resetMargin(getItems($cfs), opts); $cfs.init(opts_orig); setSizes($cfs, opts); } return opts; }); $cfs.bind('linkAnchors.cfs'+serial, function(e, $con, sel) { e.stopPropagation(); if (typeof $con == 'undefined' || $con.length == 0) $con = $('body'); else if (typeof $con == 'string') $con = $($con); if (typeof $con != 'object') return debug(opts.debug, 'Not a valid object.'); if (typeof sel != 'string' || sel.length == 0) sel = 'a.rosterslider'; $con.find(sel).each(function() { var h = this.hash || ''; if (h.length > 0 && getItems($cfs).index($(h)) != -1) { $(this).unbind('click').click(function(e) { e.preventDefault(); $cfs.trigger('slideTo', h); }); } }); }); $cfs.bind('updatePageStatus.cfs'+serial, function(e, build, sizes) { e.stopPropagation(); if (!opts.pagination.container) return; if (typeof build == 'boolean' && build) { getItems(opts.pagination.container).remove(); for (var a = 0, l = Math.ceil(totalItems/opts.items.visible); a < l; a++) { var i = getItems($cfs).eq( getItemIndex(a*opts.items.visible, 0, true, firstItem, totalItems, $cfs) ); opts.pagination.container.append(opts.pagination.anchorBuilder(a+1, i)); } getItems(opts.pagination.container).unbind(opts.pagination.event).each(function(a) { $(this).bind(opts.pagination.event, function(e) { e.preventDefault(); $cfs.trigger('slideTo', [a * opts.items.visible, 0, true, opts.pagination]); }); }); } var cnr = $cfs.triggerHandler('currentPage'); getItems(opts.pagination.container).removeClass('selected').eq(cnr).addClass('selected'); }); $cfs.bind('destroy.cfs'+serial, function(e, orgOrder) { e.stopPropagation(); if (orgOrder) { $cfs.trigger('jumpToStart'); } if (opts.usePadding) { resetMargin(getItems($cfs), opts); } $cfs.trigger('pause').css($cfs.data('cfs_origCss')); $cfs.unbind_events(); $cfs.unbind_buttons(); $wrp.replaceWith($cfs); }); // DEPRECATED $cfs.bind('slidePrev.cfs'+serial, function(e, sO, nI) { e.stopPropagation(); debug(true, 'The custom event "slidePrev" is deprecated, use "slide_prev".'); $cfs.trigger('slide_prev', [sO, nI]); }); $cfs.bind('slideNext.cfs'+serial, function(e, sO, nI) { e.stopPropagation(); debug(true, 'The custom event "slideNext" is deprecated, use "slide_next".'); $cfs.trigger('slide_next', [sO, nI]); }); // /DEPRECATED }; // /bind_events $cfs.unbind_events = function() { $cfs.unbind('.cfs'+serial); }; // /unbind_events $cfs.bind_buttons = function() { $cfs.unbind_buttons(); showNavi(opts, totalItems); enableNavi(opts, firstItem); if (opts.auto.pauseOnHover) { $wrp.bind('mouseenter.cfs'+serial, function() { $cfs.trigger('pause'); }) .bind('mouseleave.cfs'+serial, function() { $cfs.trigger('play'); }); } if (opts.prev.button) { opts.prev.button.bind(opts.prev.event+'.cfs'+serial, function(e) { e.preventDefault(); $cfs.trigger('prev'); }); if (opts.prev.pauseOnHover) { opts.prev.button.bind('mouseenter.cfs'+serial, function() { $cfs.trigger('pause'); }) .bind('mouseleave.cfs'+serial, function() { $cfs.trigger('play'); }); } } if (opts.next.button) { opts.next.button.bind(opts.next.event+'.cfs'+serial, function(e) { e.preventDefault(); $cfs.trigger('next'); }); if (opts.next.pauseOnHover) { opts.next.button.bind('mouseenter.cfs'+serial, function() { $cfs.trigger('pause'); }) .bind('mouseleave.cfs'+serial, function() { $cfs.trigger('play'); }); } } if ($.fn.mousewheel) { if (opts.prev.mousewheel) { $wrp.mousewheel(function(e, delta) { if (delta > 0) { e.preventDefault(); num = (typeof opts.prev.mousewheel == 'number') ? opts.prev.mousewheel : null; $cfs.trigger('prev', num); } }); } if (opts.next.mousewheel) { $wrp.mousewheel(function(e, delta) { if (delta < 0) { e.preventDefault(); num = (typeof opts.next.mousewheel == 'number') ? opts.next.mousewheel : null; $cfs.trigger('next', num); } }); } } if ($.fn.touchwipe) { var wP = (opts.prev.wipe) ? function() { $cfs.trigger('prev') } : null, wN = (opts.next.wipe) ? function() { $cfs.trigger('next') } : null; if (wN || wN) { var twOps = { 'min_move_x': 30, 'min_move_y': 30, 'preventDefaultEvents': true }; if (opts.direction == 'up' || opts.direction == 'down') { twOps.wipeUp = wN; twOps.wipeDown = wP; } else { twOps.wipeLeft = wN; twOps.wipeRight = wP; } $wrp.touchwipe(twOps); } } if (opts.pagination.container) { if (opts.pagination.pauseOnHover) { opts.pagination.container.bind('mouseenter.cfs'+serial, function() { $cfs.trigger('pause'); }) .bind('mouseleave.cfs'+serial, function() { $cfs.trigger('play'); }); } } if (opts.prev.key || opts.next.key) { $(document).bind('keyup.cfs'+serial, function(e) { var k = e.keyCode; if (k == opts.next.key) { e.preventDefault(); $cfs.trigger('next'); } if (k == opts.prev.key) { e.preventDefault(); $cfs.trigger('prev'); } }); } if (opts.pagination.keys) { $(document).bind('keyup.cfs'+serial, function(e) { var k = e.keyCode; if (k >= 49 && k < 58) { k = (k-49) * opts.items.visible; if (k <= totalItems) { e.preventDefault(); $cfs.trigger('slideTo', [k, 0, true, opts.pagination]); } } }); } if (opts.auto.play) { $cfs.trigger('play', opts.auto.delay); if ($.fn.nap && opts.auto.nap) { $cfs.nap('pause', 'play'); } } }; // /bind_buttons $cfs.unbind_buttons = function() { $(document).unbind('.cfs'+serial); $wrp.unbind('.cfs'+serial); if (opts.prev.button) opts.prev.button.unbind('.cfs'+serial); if (opts.next.button) opts.next.button.unbind('.cfs'+serial); if (opts.pagination.container) opts.pagination.container.unbind('.cfs'+serial); showNavi(opts, 'hide'); enableNavi(opts, 'removeClass'); if (opts.pagination.container) { getItems(opts.pagination.container).remove(); } }; // /unbind_buttons // DEPRECATED $cfs.configuration = function(a, b) { debug(true, 'The "configuration" public method is deprecated, use the "configuration" custom event.'); var cr = false; var fn = function(val) { cr = val; }; if (!a) a = fn; if (!b) b = fn; $cfs.trigger('configuration', [a, b]); return cr; }; $cfs.current_position = function() { debug(true, 'The "current_position" public method is deprecated, use the "currentPosition" custom event.'); var cp = false; $cfs.trigger('currentPosition', function(val) { cp = val; }); return cp; }; $cfs.destroy = function() { debug(true, 'The "destroy" public method is deprecated, use the "destroy" custom event.'); $cfs.trigger('destroy'); return $cfs; }; $cfs.link_anchors = function($c, se) { debug(true, 'The "link_anchors" public method is deprecated, use the "linkAnchors" custom event.'); $cfs.trigger('linkAnchors', [$c, se]); return $cfs; }; // /DEPRECATED if ($cfs.parent().is('.rosterslider_wrapper')) { var strt = $cfs.triggerHandler( 'currentPosition' ); $cfs.trigger('destroy', true); } else { var strt = false; } var $wrp = $cfs.wrap('
    ').parent(), opts = {}, opts_orig = o, totalItems = getItems($cfs).length, firstItem = 0, autoTimeout = null, autoInterval = null, timerInterval = null, pauseTimePassed = 0, isPaused = true, direction = 'next', queue = [], serial = $.fn.rosterSlider.serial++; $cfs.init(opts_orig, true, strt); $cfs.build(); $cfs.bind_events(); $cfs.bind_buttons(); if (opts.items.start != 0) { var s = opts.items.start; if (s === true) { s = window.location.hash; if (!s.length) s = 0; } else if (s === 'random') { s = Math.floor(Math.random() * totalItems); } $cfs.trigger('slideTo', [s, 0, true, { duration: 0 }, 'next']); } var siz = setSizes($cfs, opts, false), itm = getCurrentItems(getItems($cfs), opts); if (opts.onCreate) { opts.onCreate.call($tt0, itm, siz); } $cfs.trigger('updatePageStatus', [true, siz]); $cfs.trigger('linkAnchors'); return this; }; // public $.fn.rosterSlider.serial = 0; $.fn.rosterSlider.defaults = { 'debug' : false, 'synchronise' : false, 'infinite' : true, 'circular' : true, 'direction' : 'left', 'items' : { 'start' : 0 }, 'scroll' : { 'easing' : 'swing', 'pauseOnHover' : false, 'mousewheel' : false, 'wipe' : false, 'event' : 'click', 'queue' : false } }; $.fn.rosterSlider.pageAnchorBuilder = function(nr, itm) { return ''+nr+''; }; // private function fx_fade(sO, c, x, d, f) { var o = { 'duration' : d, 'easing' : sO.easing }; if (typeof f == 'function') o.complete = f; c.animate({ opacity: x }, o); } function fx_cover(sO, c1, c2, o, d, prev) { var old_w = getSizes(getOldItemsNext(getItems(c1), o), o, true)[0], new_w = getSizes(getItems(c2), o, true)[0], cur_l = (prev) ? -new_w : old_w, css_o = {}, ani_o = {}; css_o[o.d['width']] = new_w; css_o[o.d['left']] = cur_l; ani_o[o.d['left']] = 0; c1.animate({ opacity: '+=0' }, d); c2.css(css_o).animate(ani_o, { duration: d, easing: sO.easing, complete: function() { $(this).remove(); } }); } function fx_uncover(sO, c1, c2, o, d, prev, n) { var new_w = getSizes(getNewItemsNext(getItems(c1), o, n), o, true)[0], old_w = getSizes(getItems(c2), o, true)[0], cur_l = (prev) ? -old_w : new_w, css_o = {}, ani_o = {}; css_o[o.d['width']] = old_w; css_o[o.d['left']] = 0; ani_o[o.d['left']] = cur_l; c2.css(css_o).animate(ani_o, { duration: d, easing: sO.easing, complete: function() { $(this).remove(); } }); } function showNavi(o, t) { if (t == 'show' || t == 'hide') { var f = t; } else if (o.items.minimum >= t) { debug(o.debug, 'Not enough items: hiding navigation ('+t+' items, '+o.items.minimum+' needed).'); var f = 'hide'; } else { var f = 'show'; } if (o.prev.button) o.prev.button[f](); if (o.next.button) o.next.button[f](); if (o.pagination.container) o.pagination.container[f](); } function enableNavi(o, f) { if (o.circular || o.infinite) return; var fx = (f == 'removeClass' || f == 'addClass') ? f : false; if (o.next.button) { var fn = fx || (f == o.items.visible) ? 'addClass' : 'removeClass'; o.next.button[fn]('disabled'); } if (o.prev.button) { var fn = fx || (f == 0) ? 'addClass' : 'removeClass'; o.prev.button[fn]('disabled'); } } function sortParams(vals, typs) { var _arr = []; for (var a = 0, l1 = vals.length; a < l1; a++) { for (var b = 0, l2 = typs.length; b < l2; b++) { if (typs[b].indexOf(typeof vals[a]) > -1 && !_arr[b]) { _arr[b] = vals[a]; break; } } } return _arr; } function getSynchArr(s) { if (!is_array(s)) s = [[s]]; if (!is_array(s[0])) s = [s]; for (var j = 0, l = s.length; j < l; j++) { if (typeof s[j][0] == 'string') s[j][0] = $(s[j][0]); if (typeof s[j][1] != 'boolean') s[j][1] = true; if (typeof s[j][2] != 'boolean') s[j][2] = true; if (typeof s[j][3] != 'number') s[j][3] = 0; } return s; } function getKeyCode(k) { if (k == 'right') return 39; if (k == 'left') return 37; if (k == 'up') return 38; if (k == 'down') return 40; return -1; } function getObject($tt, obj) { if (typeof obj == 'function') obj = obj.call($tt); if (typeof obj == 'undefined') obj = {}; return obj; } function getNaviObject($tt, obj, pagi, auto) { if (typeof pagi != 'boolean') pagi = false; if (typeof auto != 'boolean') auto = false; obj = getObject($tt, obj); if (typeof obj == 'string') { var temp = getKeyCode(obj); if (temp == -1) obj = $(obj); else obj = temp; } // pagination if (pagi) { if (typeof obj == 'boolean') obj = { 'keys': obj }; if (typeof obj.jquery != 'undefined') obj = { 'container': obj }; if (typeof obj.container == 'function') obj.container = obj.container.call($tt); if (typeof obj.container == 'string') obj.container = $(obj.container); // auto } else if (auto) { if (typeof obj == 'boolean') obj = { 'play': obj }; if (typeof obj == 'number') obj = { 'pauseDuration': obj }; // prev + next } else { if (typeof obj.jquery != 'undefined') obj = { 'button': obj }; if (typeof obj == 'number') obj = { 'key': obj }; if (typeof obj.button == 'function') obj.button = obj.button.call($tt); if (typeof obj.button == 'string') obj.button = $(obj.button); if (typeof obj.key == 'string') obj.key = getKeyCode(obj.key); } return obj; } function getItemIndex(num, dev, org, firstItem, totalItems, $cfs) { if (typeof num == 'string') { if (isNaN(num)) num = $(num); else num = parseInt(num); } if (typeof num == 'object') { if (typeof num.jquery == 'undefined') num = $(num); num = getItems($cfs).index(num); if (num == -1) num = 0; if (typeof org != 'boolean') org = false; } else { if (typeof org != 'boolean') org = true; } if (isNaN(num)) num = 0; else num = parseInt(num); if (isNaN(dev)) dev = 0; else dev = parseInt(dev); if (org) { num += firstItem; } num += dev; if (totalItems > 0) { while (num >= totalItems) { num -= totalItems; } while (num < 0) { num += totalItems; } } return num; } function getItems(c) { return c.children(); } function getCurrentItems(i, o) { return i.slice(0, o.items.visible); } function getOldItemsPrev(i, o, n) { return i.slice(n, o.items.oldVisible+n); } function getNewItemsPrev(i, o) { return i.slice(0, o.items.visible); } function getOldItemsNext(i, o) { return i.slice(0, o.items.oldVisible); } function getNewItemsNext(i, o, n) { return i.slice(n, o.items.visible+n); } function resetMargin(i, o, m) { var x = (typeof m == 'boolean') ? m : false; if (typeof m != 'number') m = 0; i.each(function() { var t = parseInt($(this).css(o.d['marginRight'])); if (isNaN(t)) t = 0; $(this).data('cfs_tempCssMargin', t); $(this).css(o.d['marginRight'], ((x) ? $(this).data('cfs_tempCssMargin') : m + $(this).data('cfs_origCssMargin'))); }); } function getSizes(i, o, wrapper) { s1 = getTotalSize(i, o, 'width', wrapper); s2 = getLargestSize(i, o, 'height', wrapper); return [s1, s2]; } function getLargestSize(i, o, dim, wrapper) { if (typeof wrapper != 'boolean') wrapper = false; if (typeof o[o.d[dim]] == 'number' && wrapper) return o[o.d[dim]]; if (typeof o.items[o.d[dim]] == 'number') return o.items[o.d[dim]]; var di2 = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight'; return getTrueLargestSize(i, o, di2); } function getTrueLargestSize(i, o, dim) { var s = 0; i.each(function() { var m = $(this)[o.d[dim]](true); if (s < m) s = m; }); return s; } function getTrueInnerSize($el, o, dim) { var siz = $el[o.d[dim]](), arr = (o.d[dim].toLowerCase().indexOf('width') > -1) ? ['paddingLeft', 'paddingRight'] : ['paddingTop', 'paddingBottom']; for (a = 0, l = arr.length; a < l; a++) { var m = parseInt($el.css(arr[a])); if (isNaN(m)) m = 0; siz -= m; } return siz; } function getTotalSize(i, o, dim, wrapper) { if (typeof wrapper != 'boolean') wrapper = false; if (typeof o[o.d[dim]] == 'number' && wrapper) return o[o.d[dim]]; if (typeof o.items[o.d[dim]] == 'number') return o.items[o.d[dim]] * i.length; var di2 = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight'; return getTotalSizeVariable(i, o, di2); } function getTotalSizeVariable(i, o, dim) { var s = 0; i.each(function() { var j = $(this); if (j.is(':visible')) { s += j[o.d[dim]](true); } }); return s; } function hasVariableSizes(i, o, dim) { var s = false, v = false; i.each(function() { c = $(this)[o.d[dim]](true); if (s === false) s = c; else if (s != c) v = true; if (s == 0) v = true; }); return v; } function mapWrapperSizes(ws, o, p) { if (typeof p != 'boolean') p = true; var pad = (o.usePadding && p) ? o.padding : [0, 0, 0, 0]; var wra = {}; wra[o.d['width']] = ws[0] + pad[1] + pad[3]; wra[o.d['height']] = ws[1] + pad[0] + pad[2]; return wra; } function setSizes($c, o, p) { var $w = $c.parent(), $i = getItems($c), $v = getCurrentItems($i, o), sz = mapWrapperSizes(getSizes($v, o, true), o, p); $w.css(sz); if (o.usePadding) { var $l = $v.last(); $l.css(o.d['marginRight'], $l.data('cfs_origCssMargin') + o.padding[o.d[1]]); $c.css(o.d['top'], o.padding[o.d[0]]); $c.css(o.d['left'], o.padding[o.d[3]]); } $c.css(o.d['width'], getTotalSize($i, o, 'width')*2); $c.css(o.d['height'], getLargestSize($i, o, 'height')); return sz; } function getPadding(p) { if (typeof p == 'undefined') return [0, 0, 0, 0]; if (typeof p == 'number') return [p, p, p, p]; else if (typeof p == 'string') p = p.split('px').join('').split(' '); if (!is_array(p)) { return [0, 0, 0, 0]; } for (var i = 0; i < 4; i++) { p[i] = parseInt(p[i]); } switch (p.length) { case 0: return [0, 0, 0, 0]; case 1: return [p[0], p[0], p[0], p[0]]; case 2: return [p[0], p[1], p[0], p[1]]; case 3: return [p[0], p[1], p[2], p[1]]; default: return [p[0], p[1], p[2], p[3]]; } } function getAlignPadding(itm, o) { var x = (typeof o[o.d['width']] == 'number') ? Math.ceil(o[o.d['width']] - getTotalSize(itm, o, 'width')) : 0; switch (o.align) { case 'left': return [0, x]; break; case 'right': return [x, 0]; break; case 'center': default: var x1 = Math.ceil(x/2), x2 = Math.floor(x/2); return [x1, x2]; break; } } function getVisibleItemsPrev(items, o, nI) { var total = 0, start = o.items.visible - nI - 1, x = 0; if (start < 0) start = items.length-1; for (var a = start; a >= 0; a--) { total += items.eq(a)[o.d['outerWidth']](true); if (total > o.maxDimention) return getVisibleItemsAdjust(x, o); if (a == 0) a = items.length; x++; } } function getVisibleItemsNext(items, o, nI) { var total = 0, x = 0; for (var a = nI, l = items.length-1; a <= l; a++) { total += items.eq(a)[o.d['outerWidth']](true); if (total > o.maxDimention) return getVisibleItemsAdjust(x, o); if (a == items.length-1) a = -1; x++; } } function getVisibleItemsAdjust(x, o) { switch (o.visibleAdjust) { case '+1': return x + 1; break; case '-1': return x - 1; break; case 'odd': if (x % 2 == 0) return x - 1; break; case 'odd+': if (x % 2 == 0) return x + 1; break; case 'even': if (x % 2 == 1) return x - 1; break; case 'even+': if (x % 2 == 1) return x + 1; break; default: return x; break; } } function is_array(a) { return typeof(a) == 'object' && (a instanceof Array); } function debug(d, m) { if (!d) return false; if (typeof m == 'string') m = 'rosterSlider: ' + m; else m = ['rosterSlider:', m]; if (window.console && window.console.log) window.console.log(m); return false; } $.fn.rosterslider = function(o) { return this.rosterSlider(o); }; })(jQuery); // source --> https://rehamed.com.my/wp-content/themes/v2u/js/vallenato.js /*! * Vallenato 1.0 * A Simple JQuery Accordion * * Designed by Switchroyale * * Use Vallenato for whatever you want, enjoy! */ jQuery(document).ready(function() { //Add Inactive Class To All Accordion Headers jQuery('.accordion-header').toggleClass('inactive-header'); //Set The Accordion Content Width var contentwidth = jQuery('.accordion-header').width(); //jQuery('.accordion-content').css({'width' : contentwidth }); //Open The First Accordion Section When Page Loads jQuery('.accordion-header').first().toggleClass('active-header').toggleClass('inactive-header'); jQuery('.accordion-content').first().slideDown().toggleClass('open-content'); // The Accordion Effect jQuery('.accordion-header').click(function () { if(jQuery(this).is('.inactive-header')) { jQuery('.active-header').toggleClass('active-header').toggleClass('inactive-header').next().slideToggle().toggleClass('open-content'); jQuery(this).toggleClass('active-header').toggleClass('inactive-header'); jQuery(this).next().slideToggle().toggleClass('open-content'); } else { jQuery(this).toggleClass('active-header').toggleClass('inactive-header'); jQuery(this).next().slideToggle().toggleClass('open-content'); } }); return false; }); // source --> https://rehamed.com.my/wp-content/themes/v2u/js/placeholders.min.js /* Placeholders.js v2.1.1 */ (function(t){"use strict";function e(t,e,r){return t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent?t.attachEvent("on"+e,r):void 0}function r(t,e){var r,n;for(r=0,n=t.length;n>r;r++)if(t[r]===e)return!0;return!1}function n(t,e){var r;t.createTextRange?(r=t.createTextRange(),r.move("character",e),r.select()):t.selectionStart&&(t.focus(),t.setSelectionRange(e,e))}function a(t,e){try{return t.type=e,!0}catch(r){return!1}}t.Placeholders={Utils:{addEventListener:e,inArray:r,moveCaret:n,changeType:a}}})(this),function(t){"use strict";function e(){}function r(t,e){var r,n,a=!!e&&t.value!==e,u=t.value===t.getAttribute(V);return(a||u)&&"true"===t.getAttribute(D)?(t.setAttribute(D,"false"),t.value=t.value.replace(t.getAttribute(V),""),t.className=t.className.replace(R,""),n=t.getAttribute(z),n&&(t.setAttribute("maxLength",n),t.removeAttribute(z)),r=t.getAttribute(I),r&&(t.type=r),!0):!1}function n(t){var e,r,n=t.getAttribute(V);return""===t.value&&n?(t.setAttribute(D,"true"),t.value=n,t.className+=" "+k,r=t.getAttribute(z),r||(t.setAttribute(z,t.maxLength),t.removeAttribute("maxLength")),e=t.getAttribute(I),e?t.type="text":"password"===t.type&&K.changeType(t,"text")&&t.setAttribute(I,"password"),!0):!1}function a(t,e){var r,n,a,u,i;if(t&&t.getAttribute(V))e(t);else for(r=t?t.getElementsByTagName("input"):p,n=t?t.getElementsByTagName("textarea"):h,i=0,u=r.length+n.length;u>i;i++)a=r.length>i?r[i]:n[i-r.length],e(a)}function u(t){a(t,r)}function i(t){a(t,n)}function l(t){return function(){b&&t.value===t.getAttribute(V)&&"true"===t.getAttribute(D)?K.moveCaret(t,0):r(t)}}function o(t){return function(){n(t)}}function c(t){return function(e){return m=t.value,"true"===t.getAttribute(D)&&m===t.getAttribute(V)&&K.inArray(C,e.keyCode)?(e.preventDefault&&e.preventDefault(),!1):void 0}}function s(t){return function(){r(t,m),""===t.value&&(t.blur(),K.moveCaret(t,0))}}function d(t){return function(){t===document.activeElement&&t.value===t.getAttribute(V)&&"true"===t.getAttribute(D)&&K.moveCaret(t,0)}}function g(t){return function(){u(t)}}function v(t){t.form&&(L=t.form,L.getAttribute(P)||(K.addEventListener(L,"submit",g(L)),L.setAttribute(P,"true"))),K.addEventListener(t,"focus",l(t)),K.addEventListener(t,"blur",o(t)),b&&(K.addEventListener(t,"keydown",c(t)),K.addEventListener(t,"keyup",s(t)),K.addEventListener(t,"click",d(t))),t.setAttribute(U,"true"),t.setAttribute(V,E),n(t)}var p,h,b,f,m,A,y,E,x,L,T,N,S,w=["text","search","url","tel","email","password","number","textarea"],C=[27,33,34,35,36,37,38,39,40,8,46],B="#ccc",k="placeholdersjs",R=RegExp("(?:^|\\s)"+k+"(?!\\S)"),V="data-placeholder-value",D="data-placeholder-active",I="data-placeholder-type",P="data-placeholder-submit",U="data-placeholder-bound",j="data-placeholder-focus",q="data-placeholder-live",z="data-placeholder-maxlength",F=document.createElement("input"),G=document.getElementsByTagName("head")[0],H=document.documentElement,J=t.Placeholders,K=J.Utils;if(J.nativeSupport=void 0!==F.placeholder,!J.nativeSupport){for(p=document.getElementsByTagName("input"),h=document.getElementsByTagName("textarea"),b="false"===H.getAttribute(j),f="false"!==H.getAttribute(q),A=document.createElement("style"),A.type="text/css",y=document.createTextNode("."+k+" { color:"+B+"; }"),A.styleSheet?A.styleSheet.cssText=y.nodeValue:A.appendChild(y),G.insertBefore(A,G.firstChild),S=0,N=p.length+h.length;N>S;S++)T=p.length>S?p[S]:h[S-p.length],E=T.attributes.placeholder,E&&(E=E.nodeValue,E&&K.inArray(w,T.type)&&v(T));x=setInterval(function(){for(S=0,N=p.length+h.length;N>S;S++)T=p.length>S?p[S]:h[S-p.length],E=T.attributes.placeholder,E&&(E=E.nodeValue,E&&K.inArray(w,T.type)&&(T.getAttribute(U)||v(T),(E!==T.getAttribute(V)||"password"===T.type&&!T.getAttribute(I))&&("password"===T.type&&!T.getAttribute(I)&&K.changeType(T,"text")&&T.setAttribute(I,"password"),T.value===T.getAttribute(V)&&(T.value=E),T.setAttribute(V,E))));f||clearInterval(x)},100)}J.disable=J.nativeSupport?e:u,J.enable=J.nativeSupport?e:i}(this); // source --> https://rehamed.com.my/wp-content/themes/v2u/js/jquery.easing.1.3.js /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); /* * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright © 2001 Robert Penner * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */; // source --> https://rehamed.com.my/wp-content/themes/v2u/js/jquery.mousewheel.js /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.0.6 * * Requires: 1.2.2+ */ (function($) { var types = ['DOMMouseScroll', 'mousewheel']; if ($.event.fixHooks) { for ( var i=types.length; i; ) { $.event.fixHooks[ types[--i] ] = $.event.mouseHooks; } } $.event.special.mousewheel = { setup: function() { if ( this.addEventListener ) { for ( var i=types.length; i; ) { this.addEventListener( types[--i], handler, false ); } } else { this.onmousewheel = handler; } }, teardown: function() { if ( this.removeEventListener ) { for ( var i=types.length; i; ) { this.removeEventListener( types[--i], handler, false ); } } else { this.onmousewheel = null; } } }; $.fn.extend({ mousewheel: function(fn) { return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); }, unmousewheel: function(fn) { return this.unbind("mousewheel", fn); } }); function handler(event) { var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; event = $.event.fix(orgEvent); event.type = "mousewheel"; // Old school scrollwheel delta if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; } if ( orgEvent.detail ) { delta = -orgEvent.detail/3; } // New school multidimensional scroll (touchpads) deltas deltaY = delta; // Gecko if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { deltaY = 0; deltaX = -1*delta; } // Webkit if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } // Add event and delta to the front of the arguments args.unshift(event, delta, deltaX, deltaY); return ($.event.dispatch || $.event.handle).apply(this, args); } })(jQuery); // source --> https://rehamed.com.my/wp-content/themes/v2u/js/organictabs.jquery.js (function($) { $.organicTabs = function(el, options) { var base = this; base.$el = $(el); base.$nav = base.$el.find(".tab-nav"); base.init = function() { base.options = $.extend({},$.organicTabs.defaultOptions, options); // Accessible hiding fix $(".hide").css({ "position": "relative", "top": 0, "left": 0, "display": "none" }); base.$nav.delegate("li > a", "click", function() { // Figure out current list via CSS class var curList = base.$el.find("a.current").attr("href").substring(1), // List moving to $newList = $(this), // Figure out ID of new list listID = $newList.attr("href").substring(1), // Set outer wrapper height to (static) height of current inner list $allListWrap = base.$el.find(".list-wrap"), curListHeight = $allListWrap.height(); $allListWrap.height(curListHeight); if ((listID != curList) && ( base.$el.find(":animated").length == 0)) { // Fade out current list base.$el.find("#"+curList).fadeOut(base.options.speed, function() { // Fade in new list on callback base.$el.find("#"+listID).fadeIn(base.options.speed); // Adjust outer wrapper to fit new list snuggly var newHeight = base.$el.find("#"+listID).height(); $allListWrap.animate({ height: newHeight }); // Remove highlighting - Add to just-clicked tab base.$el.find(".tab-nav li a").removeClass("current"); $newList.addClass("current"); }); } // Don't behave like a regular link // Stop propegation and bubbling return false; }); }; base.init(); }; $.organicTabs.defaultOptions = { "speed": 300 }; $.fn.organicTabs = function(options) { return this.each(function() { (new $.organicTabs(this, options)); }); }; })(jQuery); // source --> https://rehamed.com.my/wp-content/themes/v2u/js/jquery.mobile.customized.min.js // jQuery Mobile framework customized for Responsive_DG_Slider slideshow, made by // 'jquery.mobile.define.js', // 'jquery.ui.widget.js', // 'jquery.mobile.widget.js', // 'jquery.mobile.media.js', // 'jquery.mobile.support.js', // 'jquery.mobile.vmouse.js', // 'jquery.mobile.event.js', // 'jquery.mobile.core.js' window.define=function(){Array.prototype.slice.call(arguments).pop()(window.jQuery)};define(["jquery"],function(a){(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++){a(e).triggerHandler("remove")}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){if(!c){if(!b||a.filter(b,[this]).length){a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")})}}return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1];f=e+"-"+b;if(!d){d=c;c=a.Widget}a.expr[":"][f]=function(c){return!!a.data(c,b)};a[e]=a[e]||{};a[e][b]=function(a,b){if(arguments.length){this._createWidget(a,b)}};var g=new c;g.options=a.extend(true,{},g.options);a[e][b].prototype=a.extend(true,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d);a.widget.bridge(b,a[e][b])};a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e==="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[true,e].concat(g)):e;if(f&&e.charAt(0)==="_"){return h}if(f){this.each(function(){var d=a.data(this,c);if(!d){throw"cannot call methods on "+c+" prior to initialization; "+"attempted to call method '"+e+"'"}if(!a.isFunction(d[e])){throw"no such method '"+e+"' for "+c+" widget instance"}var f=d[e].apply(d,g);if(f!==d&&f!==b){h=f;return false}})}else{this.each(function(){var b=a.data(this,c);if(b){b.option(e||{})._init()}else{a.data(this,c,new d(e,this))}})}return h}};a.Widget=function(a,b){if(arguments.length){this._createWidget(a,b)}};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,c){a.data(c,this.widgetName,this);this.element=a(c);this.options=a.extend(true,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){var b={};if(a.metadata){b=a.metadata.get(element)[this.widgetName]}return b},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0){return a.extend({},this.options)}if(typeof c==="string"){if(d===b){return this.options[c]}e={};e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b;if(a==="disabled"){this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,c,d){var e=this.options[b];c=a.Event(c);c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();d=d||{};if(c.originalEvent){for(var f=a.event.props.length,g;f;){g=a.event.props[--f];c[g]=c.originalEvent[g]}}this.element.trigger(c,d);return!(a.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery)});define(["jquery","./jquery.ui.widget"],function(a){(function(a,b){a.widget("mobile.widget",{_createWidget:function(){a.Widget.prototype._createWidget.apply(this,arguments);this._trigger("init")},_getCreateOptions:function(){var c=this.element,d={};a.each(this.options,function(a){var e=c.jqmData(a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()}));if(e!==b){d[a]=e}});return d},enhanceWithin:function(b){var c=a.mobile.closestPageData(a(b)),d=c&&c.keepNativeSelector()||"";a(this.options.initSelector,b).not(d)[this.widgetName]()}})})(jQuery)});define(["jquery","./jquery.mobile.core"],function(a){(function(a,b){var c=a(window),d=a("html");a.mobile.media=function(){var b={},c=a("
    "),e=a("").append(c);return function(a){if(!(a in b)){var f=document.createElement("style"),g="@media "+a+" { #jquery-mediatest { position:absolute; } }";f.type="text/css";if(f.styleSheet){f.styleSheet.cssText=g}else{f.appendChild(document.createTextNode(g))}d.prepend(e).prepend(f);b[a]=c.css("position")==="absolute";e.add(f).remove()}return b[a]}}()})(jQuery)});define(["jquery","./jquery.mobile.media"],function(a){(function(a,b){function m(){var b=location.protocol+"//"+location.host+location.pathname+"ui-dir/",d=a("head base"),e=null,f="",g,h;if(!d.length){d=e=a("",{href:b}).appendTo("head")}else{f=d.attr("href")}g=a("").prependTo(c);h=g[0].href;d[0].href=f||location.pathname;if(e){e.remove()}return h.indexOf(b)===0}function l(){var b="transform-3d";return k("perspective","10px","moz")||a.mobile.media("(-"+e.join("-"+b+"),(-")+"-"+b+"),("+b+")")}function k(a,b,c){var d=document.createElement("div"),f=function(a){return a.charAt(0).toUpperCase()+a.substr(1)},g=function(a){return"-"+a.charAt(0).toLowerCase()+a.substr(1)+"-"},h=function(c){var e=g(c)+a+": "+b+";",h=f(c),i=h+f(a);d.setAttribute("style",e);if(!!d.style[i]){k=true}},j=c?[c]:e,k;for(i=0;i").prependTo("html"),d=c[0].style,e=["Webkit","Moz","O"],f="palmGetResource"in window,g=window.operamini&&{}.toString.call(window.operamini)==="[object OperaMini]",h=window.blackberry;a.extend(a.mobile,{browser:{}});a.mobile.browser.ie=function(){var a=3,b=document.createElement("div"),c=b.all||[];while(b.innerHTML="",c[0]){}return a>4?a:!a}();a.extend(a.support,{orientation:"orientation"in window&&"onorientationchange"in window,touch:"ontouchend"in document,cssTransitions:"WebKitTransitionEvent"in window||k("transition","height 100ms linear"),pushState:"pushState"in history&&"replaceState"in history,mediaquery:a.mobile.media("only all"),cssPseudoElement:!!j("content"),touchOverflow:!!j("overflowScrolling"),cssTransform3d:l(),boxShadow:!!j("boxShadow")&&!h,scrollTop:("pageXOffset"in window||"scrollTop"in document.documentElement||"scrollTop"in c[0])&&!f&&!g,dynamicBaseTag:m()});c.remove();var n=function(){var a=window.navigator.userAgent;return a.indexOf("Nokia")>-1&&(a.indexOf("Symbian/3")>-1||a.indexOf("Series60/5")>-1)&&a.indexOf("AppleWebKit")>-1&&a.match(/(BrowserNG|NokiaBrowser)\/7\.[0-3]/)}();a.mobile.ajaxBlacklist=window.blackberry&&!window.WebKitPoint||g||n;if(n){a(function(){a("head link[rel='stylesheet']").attr("rel","alternate stylesheet").attr("rel","stylesheet")})}if(!a.support.boxShadow){a("html").addClass("ui-mobile-nosupport-boxshadow")}})(jQuery)});define(["jquery"],function(a){(function(a,b,c,d){function O(b){var c=b.substr(1);return{setup:function(d,f){if(!M(this)){a.data(this,e,{})}var g=a.data(this,e);g[b]=true;k[b]=(k[b]||0)+1;if(k[b]===1){t.bind(c,H)}a(this).bind(c,N);if(s){k["touchstart"]=(k["touchstart"]||0)+1;if(k["touchstart"]===1){t.bind("touchstart",I).bind("touchend",L).bind("touchmove",K).bind("scroll",J)}}},teardown:function(d,f){--k[b];if(!k[b]){t.unbind(c,H)}if(s){--k["touchstart"];if(!k["touchstart"]){t.unbind("touchstart",I).unbind("touchmove",K).unbind("touchend",L).unbind("scroll",J)}}var g=a(this),h=a.data(this,e);if(h){h[b]=false}g.unbind(c,N);if(!M(this)){g.removeData(e)}}}}function N(){}function M(b){var c=a.data(b,e),d;if(c){for(d in c){if(c[d]){return true}}}return false}function L(a){if(r){return}B();var b=y(a.target),c;G("vmouseup",a,b);if(!o){var d=G("vclick",a,b);if(d&&d.isDefaultPrevented()){c=w(a).changedTouches[0];p.push({touchID:v,x:c.clientX,y:c.clientY});q=true}}G("vmouseout",a,b);o=false;E()}function K(b){if(r){return}var c=w(b).touches[0],d=o,e=a.vmouse.moveDistanceThreshold;o=o||Math.abs(c.pageX-m)>e||Math.abs(c.pageY-n)>e,flags=y(b.target);if(o&&!d){G("vmousecancel",b,flags)}G("vmousemove",b,flags);E()}function J(a){if(r){return}if(!o){G("vmousecancel",a,y(a.target))}o=true;E()}function I(b){var c=w(b).touches,d,e;if(c&&c.length===1){d=b.target;e=y(d);if(e.hasVirtualBinding){v=u++;a.data(d,f,v);F();D();o=false;var g=w(b).touches[0];m=g.pageX;n=g.pageY;G("vmouseover",b,e);G("vmousedown",b,e)}}}function H(b){var c=a.data(b.target,f);if(!q&&(!v||v!==c)){var d=G("v"+b.type,b);if(d){if(d.isDefaultPrevented()){b.preventDefault()}if(d.isPropagationStopped()){b.stopPropagation()}if(d.isImmediatePropagationStopped()){b.stopImmediatePropagation()}}}}function G(b,c,d){var e;if(d&&d[b]||!d&&z(c.target,b)){e=x(c,b);a(c.target).trigger(e)}return e}function F(){if(l){clearTimeout(l);l=0}}function E(){F();l=setTimeout(function(){l=0;C()},a.vmouse.resetTimerDuration)}function D(){A()}function C(){v=0;p.length=0;q=false;B()}function B(){r=true}function A(){r=false}function z(b,c){var d;while(b){d=a.data(b,e);if(d&&(!c||d[c])){return b}b=b.parentNode}return null}function y(b){var c={},d,f;while(b){d=a.data(b,e);for(f in d){if(d[f]){c[f]=c.hasVirtualBinding=true}}b=b.parentNode}return c}function x(b,c){var e=b.type,f,g,i,k,l,m,n,o;b=a.Event(b);b.type=c;f=b.originalEvent;g=a.event.props;if(e.search(/mouse/)>-1){g=j}if(f){for(n=g.length,k;n;){k=g[--n];b[k]=f[k]}}if(e.search(/mouse(down|up)|click/)>-1&&!b.which){b.which=1}if(e.search(/^touch/)!==-1){i=w(f);e=i.touches;l=i.changedTouches;m=e&&e.length?e[0]:l&&l.length?l[0]:d;if(m){for(o=0,len=h.length;oa.event.special.swipe.scrollSupressionThreshold){b.preventDefault()}}var e=b.originalEvent.touches?b.originalEvent.touches[0]:b,f={time:(new Date).getTime(),coords:[e.pageX,e.pageY],origin:a(b.target)},i;d.bind(h,j).one(g,function(b){d.unbind(h,j);if(f&&i){if(i.time-f.timea.event.special.swipe.horizontalDistanceThreshold&&Math.abs(f.coords[1]-i.coords[1])i.coords[0]?"swipeleft":"swiperight")}}f=i=c})})}};(function(a,b){function j(){var a=e();if(a!==f){f=a;c.trigger("orientationchange")}}var c=a(b),d,e,f,g,h,i={0:true,180:true};if(a.support.orientation){g=a.mobile.media("all and (orientation: landscape)");h=i[b.orientation];if(g&&h||!g&&!h){i={"-90":true,90:true}}}a.event.special.orientationchange=d={setup:function(){if(a.support.orientation&&a.mobile.orientationChangeEnabled){return false}f=e();c.bind("throttledresize",j)},teardown:function(){if(a.support.orientation&&a.mobile.orientationChangeEnabled){return false}c.unbind("throttledresize",j)},add:function(a){var b=a.handler;a.handler=function(a){a.orientation=e();return b.apply(this,arguments)}}};a.event.special.orientationchange.orientation=e=function(){var c=true,d=document.documentElement;if(a.support.orientation){c=i[b.orientation]}else{c=d&&d.clientWidth/d.clientHeight<1.1}return c?"portrait":"landscape"}})(jQuery,b);(function(){a.event.special.throttledresize={setup:function(){a(this).bind("resize",c)},teardown:function(){a(this).unbind("resize",c)}};var b=250,c=function(){f=(new Date).getTime();g=f-d;if(g>=b){d=f;a(this).trigger("throttledresize")}else{if(e){clearTimeout(e)}e=setTimeout(c,b-g)}},d=0,e,f,g})();a.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(b,c){a.event.special[b]={setup:function(){a(this).bind(c,a.noop)}}})})(jQuery,this)});define(["jquery","../external/requirejs/text!../version.txt","./jquery.mobile.widget"],function(a,b){(function(a,c,d){var e={};a.mobile=a.extend({},{version:b,ns:"",subPageUrlKey:"ui-page",activePageClass:"ui-page-active",activeBtnClass:"ui-btn-active",focusClass:"ui-focus",ajaxEnabled:true,hashListeningEnabled:true,linkBindingEnabled:true,defaultPageTransition:"fade",maxTransitionWidth:false,minScrollBack:10,touchOverflowEnabled:false,defaultDialogTransition:"pop",loadingMessage:"loading",pageLoadErrorMessage:"Error Loading Page",loadingMessageTextVisible:false,loadingMessageTheme:"a",pageLoadErrorMessageTheme:"e",autoInitializePage:true,pushStateEnabled:true,orientationChangeEnabled:true,gradeA:function(){return a.support.mediaquery||a.mobile.browser.ie&&a.mobile.browser.ie>=7},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},silentScroll:function(b){if(a.type(b)!=="number"){b=a.mobile.defaultHomeScroll}a.event.special.scrollstart.enabled=false;setTimeout(function(){c.scrollTo(0,b);a(document).trigger("silentscroll",{x:0,y:b})},20);setTimeout(function(){a.event.special.scrollstart.enabled=true},150)},nsNormalizeDict:e,nsNormalize:function(b){if(!b){return}return e[b]||(e[b]=a.camelCase(a.mobile.ns+b))},getInheritedTheme:function(a,b){var c=a[0],d="",e=/ui-(bar|body)-([a-z])\b/,f,g;while(c){var f=c.className||"";if((g=e.exec(f))&&(d=g[2])){break}c=c.parentNode}return d||b||"a"},closestPageData:function(a){return a.closest(':jqmData(role="page"), :jqmData(role="dialog")').data("page")}},a.mobile);a.fn.jqmData=function(b,c){var d;if(typeof b!="undefined"){d=this.data(b?a.mobile.nsNormalize(b):b,c)}return d};a.jqmData=function(b,c,d){var e;if(typeof c!="undefined"){e=a.data(b,c?a.mobile.nsNormalize(c):c,d)}return e};a.fn.jqmRemoveData=function(b){return this.removeData(a.mobile.nsNormalize(b))};a.jqmRemoveData=function(b,c){return a.removeData(b,a.mobile.nsNormalize(c))};a.fn.removeWithDependents=function(){a.removeWithDependents(this)};a.removeWithDependents=function(b){var c=a(b);(c.jqmData("dependents")||a()).remove();c.remove()};a.fn.addDependents=function(b){a.addDependents(a(this),b)};a.addDependents=function(b,c){var d=a(b).jqmData("dependents")||a();a(b).jqmData("dependents",a.merge(d,c))};a.fn.getEncodedText=function(){return a("
    ").text(a(this).text()).html()};var f=a.find,g=/:jqmData\(([^)]*)\)/g;a.find=function(b,c,d,e){b=b.replace(g,"[data-"+(a.mobile.ns||"")+"$1]");return f.call(this,b,c,d,e)};a.extend(a.find,f);a.find.matches=function(b,c){return a.find(b,null,null,c)};a.find.matchesSelector=function(b,c){return a.find(c,null,null,[b]).length>0}})(jQuery,this)}); // source --> https://rehamed.com.my/wp-content/themes/v2u/js/fluid_dg.min.js // Responsive_DG_Slider slideshow v1.3.3 - a jQuery slideshow with many effects, transitions, easy to customize, using canvas and mobile ready, based on jQuery 1.4+ // Copyright (c) 2013 by Dhiraj Kumar - http://www.css-jquery-design.com// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php ; (function (a) { a.fn.fluid_dg = function (b, c) { function e() { if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)) { return true } } function H() { var b = a(s).width(); a("li", s).removeClass("fluid_dg_visThumb"); a("li", s).each(function () { var c = a(this).position(), d = a("ul", s).outerWidth(), e = a("ul", s).offset().left, f = a("> div", s).offset().left, g = f - e; if (g > 0) { a(".fluid_dg_prevThumbs", V).removeClass("hideNav") } else { a(".fluid_dg_prevThumbs", V).addClass("hideNav") } if (d - g > b) { a(".fluid_dg_nextThumbs", V).removeClass("hideNav") } else { a(".fluid_dg_nextThumbs", V).addClass("hideNav") } var h = c.left, i = c.left + a(this).width(); if (i - g <= b && h - g >= 0) { a(this).addClass("fluid_dg_visThumb") } }) } function K() { function d() { t = f.width(); if (b.height.indexOf("%") != -1) { var c = Math.round(t / (100 / parseFloat(b.height))); if (b.minHeight != "" && c < parseFloat(b.minHeight)) { u = parseFloat(b.minHeight) } else { u = c } f.css({ height: u }) } else if (b.height == "auto") { u = f.height() } else { u = parseFloat(b.height); f.css({ height: u }) } a(".fluid_dgrelative", k).css({ width: t, height: u }); a(".imgLoaded", k).each(function () { var c = a(this), d = c.attr("width"), e = c.attr("height"), f = c.index(), g, h, i = c.attr("data-alignment"), j = c.attr("data-portrait"); if (typeof i === "undefined" || i === false || i === "") { i = b.alignment } if (typeof j === "undefined" || j === false || j === "") { j = b.portrait } if (j == false || j == "false") { if (d / e < t / u) { var k = t / d; var l = Math.abs(u - e * k) * .5; switch (i) { case "topLeft": g = 0; break; case "topCenter": g = 0; break; case "topRight": g = 0; break; case "centerLeft": g = "-" + l + "px"; break; case "center": g = "-" + l + "px"; break; case "centerRight": g = "-" + l + "px"; break; case "bottomLeft": g = "-" + l * 2 + "px"; break; case "bottomCenter": g = "-" + l * 2 + "px"; break; case "bottomRight": g = "-" + l * 2 + "px"; break } c.css({ height: e * k, "margin-left": 0, "margin-top": g, position: "absolute", visibility: "visible", width: t }) } else { var k = u / e; var l = Math.abs(t - d * k) * .5; switch (i) { case "topLeft": h = 0; break; case "topCenter": h = "-" + l + "px"; break; case "topRight": h = "-" + l * 2 + "px"; break; case "centerLeft": h = 0; break; case "center": h = "-" + l + "px"; break; case "centerRight": h = "-" + l * 2 + "px"; break; case "bottomLeft": h = 0; break; case "bottomCenter": h = "-" + l + "px"; break; case "bottomRight": h = "-" + l * 2 + "px"; break } c.css({ height: u, "margin-left": h, "margin-top": 0, position: "absolute", visibility: "visible", width: d * k }) } } else { if (d / e < t / u) { var k = u / e; var l = Math.abs(t - d * k) * .5; switch (i) { case "topLeft": h = 0; break; case "topCenter": h = l + "px"; break; case "topRight": h = l * 2 + "px"; break; case "centerLeft": h = 0; break; case "center": h = l + "px"; break; case "centerRight": h = l * 2 + "px"; break; case "bottomLeft": h = 0; break; case "bottomCenter": h = l + "px"; break; case "bottomRight": h = l * 2 + "px"; break } c.css({ height: u, "margin-left": h, "margin-top": 0, position: "absolute", visibility: "visible", width: d * k }) } else { var k = t / d; var l = Math.abs(u - e * k) * .5; switch (i) { case "topLeft": g = 0; break; case "topCenter": g = 0; break; case "topRight": g = 0; break; case "centerLeft": g = l + "px"; break; case "center": g = l + "px"; break; case "centerRight": g = l + "px"; break; case "bottomLeft": g = l * 2 + "px"; break; case "bottomCenter": g = l * 2 + "px"; break; case "bottomRight": g = l * 2 + "px"; break } c.css({ height: e * k, "margin-left": 0, "margin-top": g, position: "absolute", visibility: "visible", width: t }) } } }) } var c; if (I == true) { clearTimeout(c); c = setTimeout(d, 200) } else { d() } I = true } function X(a) { for (var b, c, d = a.length; d; b = parseInt(Math.random() * d), c = a[--d], a[d] = a[b], a[b] = c); return a } function Y(a) { return Math.ceil(a) == Math.floor(a) } function hb() { if (a(s).length && !a(r).length) { var b = a(s).outerWidth(), c = a("ul > li", s).outerWidth(), d = a("li.fluid_dgcurrent", s).length ? a("li.fluid_dgcurrent", s).position() : "", e = a("ul > li", s).length * a("ul > li", s).outerWidth(), g = a("ul", s).offset().left, h = a("> div", s).offset().left, i; if (g < 0) { i = "-" + (h - g) } else { i = h - g } if (gb == true) { a("ul", s).width(a("ul > li", s).length * a("ul > li", s).outerWidth()); if (a(s).length && !a(r).lenght) { f.css({ marginBottom: a(s).outerHeight() }) } H(); a("ul", s).width(a("ul > li", s).length * a("ul > li", s).outerWidth()); if (a(s).length && !a(r).lenght) { f.css({ marginBottom: a(s).outerHeight() }) } } gb = false; var j = a("li.fluid_dgcurrent", s).length ? d.left : "", k = a("li.fluid_dgcurrent", s).length ? d.left + a("li.fluid_dgcurrent", s).outerWidth() : ""; if (j < a("li.fluid_dgcurrent", s).outerWidth()) { j = 0 } if (k - i > b) { if (j + b < e) { a("ul", s).animate({ "margin-left": "-" + j + "px" }, 500, H) } else { a("ul", s).animate({ "margin-left": "-" + (a("ul", s).outerWidth() - b) + "px" }, 500, H) } } else if (j - i < 0) { a("ul", s).animate({ "margin-left": "-" + j + "px" }, 500, H) } else { a("ul", s).css({ "margin-left": "auto", "margin-right": "auto" }); setTimeout(H, 100) } } } function ib() { bb = 0; var c = a(".fluid_dg_bar_cont", V).width(), d = a(".fluid_dg_bar_cont", V).height(); if (h != "pie") { switch (U) { case "leftToRight": a("#" + i).css({ right: c }); break; case "rightToLeft": a("#" + i).css({ left: c }); break; case "topToBottom": a("#" + i).css({ bottom: d }); break; case "bottomToTop": a("#" + i).css({ top: d }); break } } else { db.clearRect(0, 0, b.pieDiameter, b.pieDiameter) } } function jb(c) { j.addClass("fluid_dgsliding"); R = false; var d = parseFloat(a("div.fluid_dgSlide.fluid_dgcurrent", k).index()); if (c > 0) { var l = c - 1 } else if (d == B - 1) { var l = 0 } else { var l = d + 1 } var m = a(".fluid_dgSlide:eq(" + l + ")", k); var n = a(".fluid_dgSlide:eq(" + (l + 1) + ")", k).addClass("fluid_dgnext"); if (d != l + 1) { n.hide() } a(".fluid_dgContent", g).fadeOut(600); a(".fluid_dg_caption", g).show(); a(".fluid_dgrelative", m).append(a("> div ", j).eq(l).find("> div.fluid_dg_effected")); a(".fluid_dg_target_content .fluid_dgContent:eq(" + l + ")", f).append(a("> div ", j).eq(l).find("> div")); if (!a(".imgLoaded", m).length) { var o = v[l]; var p = new Image; p.src = o + "?" + (new Date).getTime(); m.css("visibility", "hidden"); m.prepend(a(p).attr("class", "imgLoaded").css("visibility", "hidden")); var q, w; if (!a(p).get(0).complete || q == "0" || w == "0" || typeof q === "undefined" || q === false || typeof w === "undefined" || w === false) { a(".fluid_dg_loader", f).delay(500).fadeIn(400); p.onload = function () { q = p.naturalWidth; w = p.naturalHeight; a(p).attr("data-alignment", z[l]).attr("data-portrait", y[l]); a(p).attr("width", q); a(p).attr("height", w); k.find(".fluid_dgSlide_" + l).hide().css("visibility", "visible"); K(); jb(l + 1) } } } else { if (v.length > l + 1 && !a(".imgLoaded", n).length) { var x = v[l + 1]; var A = new Image; A.src = x + "?" + (new Date).getTime(); n.prepend(a(A).attr("class", "imgLoaded").css("visibility", "hidden")); A.onload = function () { q = A.naturalWidth; w = A.naturalHeight; a(A).attr("data-alignment", z[l + 1]).attr("data-portrait", y[l + 1]); a(A).attr("width", q); a(A).attr("height", w); K() } } b.onLoaded.call(this); if (a(".fluid_dg_loader", f).is(":visible")) { a(".fluid_dg_loader", f).fadeOut(400) } else { a(".fluid_dg_loader", f).css({ visibility: "hidden" }); a(".fluid_dg_loader", f).fadeOut(400, function () { a(".fluid_dg_loader", f).css({ visibility: "visible" }) }) } var C = b.rows, D = b.cols, F = 1, G = 0, H, I, J, N, O, P = new Array("simpleFade", "curtainTopLeft", "curtainTopRight", "curtainBottomLeft", "curtainBottomRight", "curtainSliceLeft", "curtainSliceRight", "blindCurtainTopLeft", "blindCurtainTopRight", "blindCurtainBottomLeft", "blindCurtainBottomRight", "blindCurtainSliceBottom", "blindCurtainSliceTop", "stampede", "mosaic", "mosaicReverse", "mosaicRandom", "mosaicSpiral", "mosaicSpiralReverse", "topLeftBottomRight", "bottomRightTopLeft", "bottomLeftTopRight", "topRightBottomLeft", "scrollLeft", "scrollRight", "scrollTop", "scrollBottom", "scrollHorz"); marginLeft = 0, marginTop = 0, opacityOnGrid = 0; if (b.opacityOnGrid == true) { opacityOnGrid = 0 } else { opacityOnGrid = 1 } var Q = a(" > div", j).eq(l).attr("data-fx"); if (e() && b.mobileFx != "" && b.mobileFx != "default") { N = b.mobileFx } else { if (typeof Q !== "undefined" && Q !== false && Q !== "default") { N = Q } else { N = b.fx } } if (N == "random") { N = X(P); N = N[0] } else { N = N; if (N.indexOf(",") > 0) { N = N.replace(/ /g, ""); N = N.split(","); N = X(N); N = N[0] } } dataEasing = a(" > div", j).eq(l).attr("data-easing"); mobileEasing = a(" > div", j).eq(l).attr("data-mobileEasing"); if (e() && b.mobileEasing != "" && b.mobileEasing != "default") { if (typeof mobileEasing !== "undefined" && mobileEasing !== false && mobileEasing !== "default") { O = mobileEasing } else { O = b.mobileEasing } } else { if (typeof dataEasing !== "undefined" && dataEasing !== false && dataEasing !== "default") { O = dataEasing } else { O = b.easing } } H = a(" > div", j).eq(l).attr("data-slideOn"); if (typeof H !== "undefined" && H !== false) { T = H } else { if (b.slideOn == "random") { var T = new Array("next", "prev"); T = X(T); T = T[0] } else { T = b.slideOn } } var Y = a(" > div", j).eq(l).attr("data-time"); if (typeof Y !== "undefined" && Y !== false && Y !== "") { I = parseFloat(Y) } else { I = b.time } var Z = a(" > div", j).eq(l).attr("data-transPeriod"); if (typeof Z !== "undefined" && Z !== false && Z !== "") { J = parseFloat(Z) } else { J = b.transPeriod } if (!a(j).hasClass("fluid_dgstarted")) { N = "simpleFade"; T = "next"; O = ""; J = 400; a(j).addClass("fluid_dgstarted") } switch (N) { case "simpleFade": D = 1; C = 1; break; case "curtainTopLeft": if (b.slicedCols == 0) { D = b.cols } else { D = b.slicedCols } C = 1; break; case "curtainTopRight": if (b.slicedCols == 0) { D = b.cols } else { D = b.slicedCols } C = 1; break; case "curtainBottomLeft": if (b.slicedCols == 0) { D = b.cols } else { D = b.slicedCols } C = 1; break; case "curtainBottomRight": if (b.slicedCols == 0) { D = b.cols } else { D = b.slicedCols } C = 1; break; case "curtainSliceLeft": if (b.slicedCols == 0) { D = b.cols } else { D = b.slicedCols } C = 1; break; case "curtainSliceRight": if (b.slicedCols == 0) { D = b.cols } else { D = b.slicedCols } C = 1; break; case "blindCurtainTopLeft": if (b.slicedRows == 0) { C = b.rows } else { C = b.slicedRows } D = 1; break; case "blindCurtainTopRight": if (b.slicedRows == 0) { C = b.rows } else { C = b.slicedRows } D = 1; break; case "blindCurtainBottomLeft": if (b.slicedRows == 0) { C = b.rows } else { C = b.slicedRows } D = 1; break; case "blindCurtainBottomRight": if (b.slicedRows == 0) { C = b.rows } else { C = b.slicedRows } D = 1; break; case "blindCurtainSliceTop": if (b.slicedRows == 0) { C = b.rows } else { C = b.slicedRows } D = 1; break; case "blindCurtainSliceBottom": if (b.slicedRows == 0) { C = b.rows } else { C = b.slicedRows } D = 1; break; case "stampede": G = "-" + J; break; case "mosaic": G = b.gridDifference; break; case "mosaicReverse": G = b.gridDifference; break; case "mosaicRandom": break; case "mosaicSpiral": G = b.gridDifference; F = 1.7; break; case "mosaicSpiralReverse": G = b.gridDifference; F = 1.7; break; case "topLeftBottomRight": G = b.gridDifference; F = 6; break; case "bottomRightTopLeft": G = b.gridDifference; F = 6; break; case "bottomLeftTopRight": G = b.gridDifference; F = 6; break; case "topRightBottomLeft": G = b.gridDifference; F = 6; break; case "scrollLeft": D = 1; C = 1; break; case "scrollRight": D = 1; C = 1; break; case "scrollTop": D = 1; C = 1; break; case "scrollBottom": D = 1; C = 1; break; case "scrollHorz": D = 1; C = 1; break } var _ = 0; var ab = C * D; var eb = t - Math.floor(t / D) * D; var fb = u - Math.floor(u / C) * C; var gb; var kb; var lb = 0; var mb = 0; var nb = new Array; var ob = new Array; var pb = new Array; while (_ < ab) { nb.push(_); ob.push(_); E.append('